def test_username_of_less_than_25_characters_is_valid(self): person = Person(username='******' * 24) with self.assertRaises(AssertionError): with self.assertRaises(ValidationError): person.full_clean()
def test_username_cannot_exceed_25_characters(self): person = Person(username='******' * 26) with self.assertRaises(ValidationError): person.full_clean()