Created
November 24, 2012 12:50
-
-
Save bmispelon/4139543 to your computer and use it in GitHub Desktop.
Test for django ticket #19353
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.contrib.auth.tests.custom_user import ExtensionUser | |
| from django.contrib.auth.forms import UserCreationForm | |
| from django.test import TestCase | |
| from django.test.utils import override_settings | |
| class CustomUserCreationForm(UserCreationForm): | |
| class Meta(UserCreationForm.Meta): | |
| model = ExtensionUser | |
| class CustomUserCreationFormTest(TestCase): | |
| @override_settings(AUTH_USER_MODEL='auth.ExtensionUser') | |
| def test_form_validates(self): | |
| data = { | |
| 'username': 'jsmith', | |
| 'password1': 'test123', | |
| 'password2': 'test123', | |
| } | |
| form = CustomUserCreationForm(data) | |
| self.assertTrue(form.is_valid()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment