def _make(**kwargs): kwargs.setdefault("name", "Team%d" % count[0]) kwargs.setdefault("password", "Password%d" % count[0]) kwargs.setdefault("email", "*****@*****.**" % count[0]) kwargs.setdefault("country_id", countries[0].id) t = Team(**kwargs) t._real_password = "******" % count[0] count[0] += 1 return t
def test_validate_password(self): t = Team(password="******") assert t.password assert t.validate_password("Test123") assert not t.validate_password("Test12") assert not t.validate_password("Test123 ") assert not t.validate_password("Test12 3") assert not t.validate_password(" Test123") assert not t.validate_password("test123")