Ejemplo n.º 1
0
    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
Ejemplo n.º 2
0
    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
Ejemplo n.º 3
0
    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
Ejemplo n.º 4
0
def load_user(id):
    return User.get_by_id(int(id))
Ejemplo n.º 5
0
def load_user(user_id):
    """Load user by ID."""
    return User.get_by_id(int(user_id))
Ejemplo n.º 6
0
def load_user(id):
    return User.get_by_id(int(id))
Ejemplo n.º 7
0
def load_user(user_id):
    """Load user by ID."""
    return User.get_by_id(int(user_id))