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.
This commit is contained in:
Rebecca Law
2015-12-16 12:20:25 +00:00
parent bd8bb3c926
commit 64812c1614
18 changed files with 259 additions and 203 deletions

View File

@@ -4,13 +4,25 @@ from app.main.dao import users_dao
from app.models import User
def create_test_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='pending')
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