def test_get_by_id(self): """Get user by ID.""" user = User('foo', '*****@*****.**') user.save() retrieved = User.get_by_id(user.id) assert retrieved == user
def test_get_by_id(self): """Get user by ID.""" user = User('foo', '*****@*****.**') user.save() retrieved = User.get_by_id(user.id) assert retrieved == user
def test_email_confirmation(self, db, testapp): """Confirm a user's email address""" # Goes to registration page with mail.record_messages() as outbox: res = testapp.get(url_for('user.register')) form = res.forms['registerForm'] form['username'] = '******' form['email'] = '*****@*****.**' form['password'] = '******' form['confirm'] = 'secret' res = form.submit() body_html = outbox[0].html groups = re.search('<a href=\"http://localhost(.*)\">', body_html) confirmation_url = groups[1] res = testapp.get(confirmation_url) assert User.get_by_id(1).email_confirmed is True
def load_user(id): return User.get_by_id(int(id))
def load_user(user_id): """Load user by ID.""" return User.get_by_id(int(user_id))
def load_user(id): return User.get_by_id(int(id))
def load_user(user_id): """Load user by ID.""" return User.get_by_id(int(user_id))