From f8bbd9b9b53d6d55fc98757df08ea723e701f3aa Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Wed, 4 Oct 2017 15:59:58 +0100 Subject: [PATCH] Ensure example.doc is deleted on TestServeView teardown --- wagtail/wagtaildocs/tests/test_views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wagtail/wagtaildocs/tests/test_views.py b/wagtail/wagtaildocs/tests/test_views.py index f7dcc711f8..c759531425 100644 --- a/wagtail/wagtaildocs/tests/test_views.py +++ b/wagtail/wagtaildocs/tests/test_views.py @@ -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)))