mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-08 14:37:53 +00:00
now using bulk_update
This commit is contained in:
@@ -70,3 +70,16 @@ class DrawingsPathlibTests(TestCase):
|
||||
drawings.load_drawings_files()
|
||||
|
||||
self.assertFalse(DrawingFile.objects.filter(dwgpath='.git/secret.txt').exists())
|
||||
|
||||
def test_bulk_create_chunks(self):
|
||||
# Create more than chunk size files to ensure bulk_create is called in multiple chunks
|
||||
count = 800
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
p = pathlib.Path(td)
|
||||
for i in range(count):
|
||||
(p / f'file{i}.txt').write_text('x')
|
||||
settings.DRAWINGS_DATA = td
|
||||
|
||||
drawings.load_drawings_files()
|
||||
|
||||
self.assertEqual(DrawingFile.objects.count(), count)
|
||||
|
||||
Reference in New Issue
Block a user