~mfoord/canonical-identity-provider/account-killer

« back to all changes in this revision

Viewing changes to src/webui/tests/test_views_devices.py

  • Committer: Tarmac
  • Author(s): Diogo Baeder de Paula Pinto
  • Date: 2013-09-16 18:51:17 UTC
  • mfrom: (1055.1.13 self-service-2fa)
  • Revision ID: tarmac-20130916185117-6m7tahhrko4ffuht
[r=ricardokirkner] Basic 2fa synching - model implementation only, for now

Show diffs side-by-side

added added

removed removed

Lines of Context:
263
263
        self.assertEqual(account.twofactor_attempts, 8)
264
264
 
265
265
    def test_successful_login_resets_attempts(self):
266
 
        with mock.patch('webui.views.ui.authenticate_device'):
 
266
        with mock.patch('webui.views.ui.authenticate'):
267
267
            self.client.post(self.url, {'oath_token': '123456'})
268
268
            account = Account.objects.get(id=self.account.id)
269
269
            self.assertEqual(account.twofactor_attempts, 0)
299
299
 
300
300
            # block for some time to ensure requests are concurrent
301
301
            mock_auth_device = mock.patch(
302
 
                'webui.views.ui.authenticate_device', mocked)
 
302
                'webui.views.ui.authenticate', mocked)
303
303
            with mock_auth_device:
304
304
                response = view(request)
305
305
            self.assertEqual(response.status_code, 200)