I have set a unique constraint on email field of my Member model. Now while writing unit tests, my tests fail due to expiring unique constraint.
def setUp(self):
self.car_provider = mommy.make(Member, username="car_provider")
self.car_provider.set_password("12345678")
self.car_provider.save()
self.applicant = mommy.make(Member, username="applicant")
self.applicant.set_password("12345678")
self.applicant.save()
I get following error: "django.db.utils.IntegrityError: duplicate key value violates unique constraint "account_member_email_a727987b_uniq" DETAIL: Key (email)=() already exists."