I'm using model-mommy to generate test data like so
class AuthorDetailViewTests(TestCase):
def setUp(self):
# set bio manually to avoid error being thrown by template tag markdown_format
self.author = mommy.make('author.Author', bio='Some bio text')
def tearDown(self):
self.author.delete()
setUp()
method works fine. Problem is that the tearDown()
method doesn't actually delete the created aauthor
instance. Is there any way to achieve this? Thanks