Files
notifications-admin/tests/app/main/__init__.py
Rebecca Law 64812c1614 109898688: All codes are valid until one code is used, then they are all marked used.
Fixed the is_active() method on the Users model, if the user was pending they would come back as active, allowing a user to sign in before being active.
There is still a problem with the validate_sms_code and validate_email_code method.
2015-12-17 14:33:20 +00:00

29 lines
823 B
Python

from datetime import datetime
from app.main.dao import users_dao
from app.models import User
def create_test_user(state):
user = User(name='Test User',
password='somepassword',
email_address='test@user.gov.uk',
mobile_number='+441234123412',
created_at=datetime.now(),
role_id=1,
state=state)
users_dao.insert_user(user)
return user
def create_another_test_user(state):
user = User(name='Another Test User',
password='someOtherpassword',
email_address='another_test@user.gov.uk',
mobile_number='+442233123412',
created_at=datetime.now(),
role_id=1,
state=state)
users_dao.insert_user(user)
return user