[Fixed]-How to test a function for different database states in Python and Django? (avoiding repetitions)

1👍

Why don’t you just destroy all the objects you don’t want in your teardown? Looks like Django allows you to do this type of thing pretty easily.

def tearDown(self):
    User.objects.all().delete()

Leave a comment