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

All Samples(12)  |  Call(9)  |  Derive(1)  |  Import(2)

src/d/j/django-otp-agents-0.2.0/otp_agents/forms.py   django-otp-agents(Download)
class OTPAuthenticationForm(django_otp.forms.OTPAuthenticationForm, OTPAgentFormMixin):
    """
    Extends :class:`~django_otp.forms.OTPAuthenticationForm` with support for
    agent trust.
    """

src/d/j/django-otp-0.2.7/django_otp/plugins/otp_static/tests.py   django-otp(Download)
from django.db import IntegrityError
 
from django_otp.forms import OTPAuthenticationForm
from django_otp.tests import TestCase
from .models import StaticDevice
    def test_empty(self):
        data = {}
        form = OTPAuthenticationForm(None, data)
 
        self.assertTrue(not form.is_valid())
            'password': 'bogus',
        }
        form = OTPAuthenticationForm(None, data)
 
        self.assertTrue(not form.is_valid())
            'password': 'password',
        }
        form = OTPAuthenticationForm(None, data)
 
        self.assertTrue(not form.is_valid())
            'otp_token': 'alice1',
        }
        form = OTPAuthenticationForm(None, data)
 
        self.assertTrue(form.is_valid())

src/d/j/django-otp-0.2.7/django_otp/plugins/otp_email/tests.py   django-otp(Download)
from django.db import IntegrityError
from django.core import mail
 
from django_otp.forms import OTPAuthenticationForm
from django_otp.tests import TestCase
            'otp_challenge': '1',
        }
        form = OTPAuthenticationForm(None, data)
 
        self.assertTrue(not form.is_valid())
        data['otp_token'] = mail.outbox[0].body
        del data['otp_challenge']
        form = OTPAuthenticationForm(None, data)
 
        self.assertTrue(form.is_valid())