def test_user_authenticate_incorrect_password(self): import transaction from babytracker.models import DBSession, User with transaction.manager: session = DBSession() session.add(User(u'*****@*****.**', u'John Smith', 'secret')) session.add(User(u'*****@*****.**', u'Jill Smith', 'foobar')) user = User.authenticate(u'*****@*****.**', 'sikrit') self.assertEqual(user, None)
def test_user_authenticate_incorrect_password(self): import transaction from babytracker.models import DBSession, User with transaction.manager: session = DBSession() session.add(User(u"*****@*****.**", u"John Smith", "secret")) session.add(User(u"*****@*****.**", u"Jill Smith", "foobar")) user = User.authenticate(u"*****@*****.**", "sikrit") self.assertEqual(user, None)
def test_user_authenticate_success(self): import transaction from babytracker.models import DBSession, User with transaction.manager: session = DBSession() session.add(User(u'*****@*****.**', u'John Smith', 'secret')) session.add(User(u'*****@*****.**', u'Jill Smith', 'foobar')) user = User.authenticate(u'*****@*****.**', 'secret') self.assertEqual(user.__name__, u'*****@*****.**')
def test_user_authenticate_success(self): import transaction from babytracker.models import DBSession, User with transaction.manager: session = DBSession() session.add(User(u"*****@*****.**", u"John Smith", "secret")) session.add(User(u"*****@*****.**", u"Jill Smith", "foobar")) user = User.authenticate(u"*****@*****.**", "secret") self.assertEqual(user.__name__, u"*****@*****.**")