I am writing a Django web app and I'm having a problem with writing test method for my model and I hope you will be able to help me with it.
I created a model:
class Animal(models.Model):
date_born = models.DateTimeField('date_born', validators=[MaxValueValidator(limit_value=timezone.now())])
New Animal instance should not be created if date_born is set to future date. I am trying to write a test in tests.py to validate if model with future date is not being created but I am not sure how to do it. Could you advise me?