diff --git a/tests/test_forms.py b/tests/test_forms.py index f8a690a43..f80f93843 100644 --- a/tests/test_forms.py +++ b/tests/test_forms.py @@ -8,3 +8,10 @@ def test_auth_token_form(self): form = AuthenticationTokenForm(None, None, data={'otp_token': '005428'}) self.assertTrue(form.is_valid()) self.assertEqual(form.cleaned_data['otp_token'], '005428') + + def test_auth_token_form_clean_device_id_fail(self): + form = AuthenticationTokenForm(None, None, data={'otp_token': '005428', + 'device_id': '123'}) + self.assertFalse(form.is_valid()) + self.assertEqual(form.errors['device_id'], + ['Device id is not valid.'])