示例#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'
示例#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'
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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 == '*****@*****.**'
示例#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)
示例#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
示例#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
示例#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 == '*****@*****.**'
示例#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)
示例#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