Add teardown method for all tests.

This commit is contained in:
Roberto Rosario
2015-07-12 03:28:31 -04:00
parent e05f6b5830
commit fd8721b297
5 changed files with 22 additions and 8 deletions

View File

@@ -21,6 +21,10 @@ class IndexTestCase(TestCase):
with open(TEST_SMALL_DOCUMENT_PATH) as file_object:
self.document = self.document_type.new_document(file_object=File(file_object))
def tearDown(self):
for document_type in DocumentType.objects.all():
document_type.delete()
def test_indexing(self):
metadata_type = MetadataType.objects.create(name='test', label='test')
DocumentTypeMetadataType.objects.create(document_type=self.document_type, metadata_type=metadata_type)