Exemple #1
0
 def test_login_attempt_is_logged(self):
     now = datetime.now()
     self.user.update(last_login_attempt=now)
     views.login_user(self.request, self.user, self.identity)
     self.login.assert_called_with(self.request, self.user)
     assert self.user.last_login_attempt > now
     assert self.user.last_login_ip == '8.8.8.8'
Exemple #2
0
 def test_login_attempt_is_logged(self):
     now = datetime.now()
     self.user.update(last_login_attempt=now)
     views.login_user(self.request, self.user, self.identity)
     self.login.assert_called_with(self.request, self.user)
     assert self.user.last_login_attempt > now
     assert self.user.last_login_ip == '8.8.8.8'
Exemple #3
0
 def test_email_address_can_change(self):
     assert len(get_messages(self.request)) == 0
     self.user.update(email='*****@*****.**')
     views.login_user(self.request, self.user, self.identity)
     user = self.user.reload()
     assert user.fxa_id == '9001'
     assert user.email == '*****@*****.**'
     assert len(get_messages(self.request)) == 0
Exemple #4
0
 def test_fxa_data_gets_set(self):
     assert len(get_messages(self.request)) == 0
     self.user.update(fxa_id=None)
     views.login_user(self.request, self.user, self.identity)
     user = self.user.reload()
     assert user.fxa_id == '9001'
     assert not user.has_usable_password()
     assert len(get_messages(self.request)) == 1
Exemple #5
0
 def test_email_address_can_change(self):
     assert len(get_messages(self.request)) == 0
     self.user.update(email='*****@*****.**')
     views.login_user(self.request, self.user, self.identity)
     user = self.user.reload()
     assert user.fxa_id == '9001'
     assert user.email == '*****@*****.**'
     assert len(get_messages(self.request)) == 0
Exemple #6
0
 def test_fxa_data_gets_set(self):
     assert len(get_messages(self.request)) == 0
     self.user.update(fxa_id=None)
     views.login_user(self.request, self.user, self.identity)
     user = self.user.reload()
     assert user.fxa_id == '9001'
     assert not user.has_usable_password()
     assert len(get_messages(self.request)) == 1
 def test_fxa_data_gets_set_migration_over(self):
     assert len(get_messages(self.request)) == 0
     self.user.update(fxa_id=None)
     self.create_switch('fxa-migrated', active=True)
     views.login_user(self.request, self.user, self.identity)
     user = self.user.reload()
     assert user.fxa_id == '9001'
     assert not user.has_usable_password()
     assert len(get_messages(self.request)) == 0
Exemple #8
0
 def test_fxa_data_gets_set_migration_over(self):
     assert len(get_messages(self.request)) == 0
     self.user.update(fxa_id=None)
     self.create_switch('fxa-migrated', active=True)
     views.login_user(self.request, self.user, self.identity)
     user = self.user.reload()
     assert user.fxa_id == '9001'
     assert not user.has_usable_password()
     assert len(get_messages(self.request)) == 0
Exemple #9
0
 def test_fxa_id_can_be_set(self):
     self.user.update(fxa_id=None)
     views.login_user(self.request, self.user, self.identity)
     user = self.user.reload()
     assert user.fxa_id == '9001'
     assert user.email == '*****@*****.**'
Exemple #10
0
 def test_user_gets_logged_in(self):
     views.login_user(self.request, self.user, self.identity)
     self.login.assert_called_with(self.request, self.user)
Exemple #11
0
 def test_auth_id_updated_if_none(self):
     self.user.update(auth_id=None)
     views.login_user(self.request, self.user, self.identity)
     self.user.reload()
     assert self.user.auth_id
Exemple #12
0
 def test_user_gets_logged_in(self):
     assert len(get_messages(self.request)) == 0
     views.login_user(self.request, self.user, self.identity)
     self.login.assert_called_with(self.request, self.user)
     assert len(get_messages(self.request)) == 0
Exemple #13
0
 def test_fxa_id_can_be_set(self):
     self.user.update(fxa_id=None)
     views.login_user(self.request, self.user, self.identity)
     user = self.user.reload()
     assert user.fxa_id == '9001'
     assert user.email == '*****@*****.**'
Exemple #14
0
 def test_user_gets_logged_in(self):
     views.login_user(self.request, self.user, self.identity)
     self.login.assert_called_with(self.request, self.user)
Exemple #15
0
 def test_user_gets_logged_in(self):
     assert len(get_messages(self.request)) == 0
     views.login_user(self.request, self.user, self.identity)
     self.login.assert_called_with(self.request, self.user)
     assert len(get_messages(self.request)) == 0