mirror of
https://github.com/wagtail/wagtail.git
synced 2024-12-01 11:41:20 +01:00
delete the FieldFile directly because the TestCase does not commit
This commit is contained in:
parent
49a416431e
commit
e6b462f13e
@ -100,8 +100,10 @@ class TestDocumentFilenameProperties(TestCase):
|
|||||||
self.assertEqual('', self.extensionless_document.file_extension)
|
self.assertEqual('', self.extensionless_document.file_extension)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
self.document.delete()
|
# delete the FieldFile directly because the TestCase does not commit
|
||||||
self.extensionless_document.delete()
|
# transactions to trigger transaction.on_commit() in the signal handler
|
||||||
|
self.document.file.delete()
|
||||||
|
self.extensionless_document.file.delete()
|
||||||
|
|
||||||
|
|
||||||
class TestFilesDeletedForDefaultModels(TransactionTestCase):
|
class TestFilesDeletedForDefaultModels(TransactionTestCase):
|
||||||
|
@ -82,7 +82,9 @@ class TestServeViewWithSendfile(TestCase):
|
|||||||
self.document.file.save('example.doc', ContentFile("A boring example document"))
|
self.document.file.save('example.doc', ContentFile("A boring example document"))
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
self.document.delete()
|
# delete the FieldFile directly because the TestCase does not commit
|
||||||
|
# transactions to trigger transaction.on_commit() in the signal handler
|
||||||
|
self.document.file.delete()
|
||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
return self.client.get(reverse('wagtaildocs_serve', args=(self.document.id, self.document.filename)))
|
return self.client.get(reverse('wagtaildocs_serve', args=(self.document.id, self.document.filename)))
|
||||||
|
Loading…
Reference in New Issue
Block a user