0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Ensure example.doc is deleted after running TestServeView

This commit is contained in:
Matt Westcott 2017-06-20 13:30:48 +01:00
parent b00377c418
commit deeee4a597

View File

@ -20,6 +20,9 @@ class TestServeView(TestCase):
self.document = models.Document(title="Test document")
self.document.file.save('example.doc', ContentFile("A boring example document"))
def tearDown(self):
self.document.delete()
def get(self):
return self.client.get(reverse('wagtaildocs_serve', args=(self.document.id, self.document.filename)))
@ -78,6 +81,9 @@ class TestServeViewWithSendfile(TestCase):
self.document = models.Document(title="Test document")
self.document.file.save('example.doc', ContentFile("A boring example document"))
def tearDown(self):
self.document.delete()
def get(self):
return self.client.get(reverse('wagtaildocs_serve', args=(self.document.id, self.document.filename)))