0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 17:36:49 +01:00

Ensure example.doc is deleted on TestServeView teardown

This commit is contained in:
Matt Westcott 2017-10-04 15:59:58 +01:00 committed by Matt Westcott
parent 62b8caedd5
commit f8bbd9b9b5

View File

@ -77,7 +77,9 @@ class TestServeView(TestCase):
self.document.file.save('example.doc', ContentFile("A boring example document"))
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):
return self.client.get(reverse('wagtaildocs_serve', args=(self.document.id, self.document.filename)))