Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)

src/d/j/django-two-factor-auth-HEAD/tests/tests.py   django-two-factor-auth(Download)
    User = get_user_model()
 
from django_otp import DEVICE_ID_SESSION_KEY, devices_for_user
from django_otp.oath import totp
from django_otp.util import random_hex
        if default_device(user):
            session = self.client.session
            session[DEVICE_ID_SESSION_KEY] = default_device(user).persistent_id
            session.save()
 
 
        self.assertEqual(device.persistent_id,
                         self.client.session.get(DEVICE_ID_SESSION_KEY))
 
        # Check that the signal was fired.
        self.assertRedirects(response, str(settings.LOGIN_REDIRECT_URL))
        self.assertEqual(device.persistent_id,
                         self.client.session.get(DEVICE_ID_SESSION_KEY))
 
        # Check that the signal was fired.
 
        self.assertEqual(device.persistent_id,
                         self.client.session.get(DEVICE_ID_SESSION_KEY))
 
    def test_suggest_backup_number(self):