

def test_signin_form(self):
    '\n        Check that the ``SigninForm`` requires both identification and password\n\n        '
    invalid_data_dicts = [{
        'data': {
            'identification': '',
            'password': 'inhalefish',
        },
        'error': ('identification', ['Either supply us with your email or username.']),
    }, {
        'data': {
            'identification': 'john',
            'password': 'inhalefish',
        },
        'error': ('__all__', ['Please enter a correct username or email and password. Note that both fields are case-sensitive.']),
    }]
    with override('en'):
        for invalid_dict in invalid_data_dicts:
            form = forms.AuthenticationForm(data=invalid_dict['data'])
            self.assertFalse(form.is_valid())
            self.assertEqual(valid_dict.errors[invalid_dict['error'][0]], invalid_dict['error'][1])
    valid_data_dicts = [{
        'identification': 'john',
        'password': 'blowfish',
    }, {
        'identification': 'john@example.com',
        'password': 'blowfish',
    }]
    for valid_dict in valid_data_dicts:
        form = forms.AuthenticationForm(valid_dict)
        self.assertTrue(form.is_valid())

dataset/ETHPy150Open bread-and-pepper/django-userena/userena/tests/tests_forms.py AuthenticationFormTests.test_signin_form/VarMisuse@124/258 `form`->`valid_dict`