예제 #1
0
    def test_create_user(self, db_client):
        user = yield User.create(User(),
                                 'password',
                                 email='*****@*****.**',
                                 first_name='test',
                                 last_name='user',
                                 has_agreed_to_terms=True)

        assert user.first_name == 'test'
        assert user.last_name == 'user'
        assert user.password != 'password'
        assert user.verify_password('password')
        assert user.state == State.approved
        assert user.verification_hash

        assert db_client().save_doc.call_count == 1
예제 #2
0
    def test_create_user(self, db_client):
        user = yield User.create(User(),
                                 'password',
                                 email='*****@*****.**',
                                 first_name='test',
                                 last_name='user',
                                 has_agreed_to_terms=True)

        assert user.first_name == 'test'
        assert user.last_name == 'user'
        assert user.password != 'password'
        assert user.verify_password('password')
        assert user.state == State.approved
        assert user.verification_hash

        assert db_client().save_doc.call_count == 1
예제 #3
0
 def test_create_user_invalid_password(self, db_client):
     with pytest.raises(exceptions.ValidationError):
         yield User.create(User(), 'p')
예제 #4
0
 def test_create_user_invalid_password(self, db_client):
     with pytest.raises(exceptions.ValidationError):
         yield User.create(User(), 'p')