summaryrefslogtreecommitdiff
path: root/tests/auth_tests/test_forms.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2016-12-01 11:38:01 +0100
committerClaude Paroz <claude@2xlibre.net>2017-01-18 16:21:28 +0100
commitc716fe87821df00f9f03ecc761c914d1682591a2 (patch)
tree0436706cdb190acbc76fb5fcf6d66f16e09fafa3 /tests/auth_tests/test_forms.py
parente63d98b7beb16d1410168a2315cbe04c43c9c80d (diff)
Refs #23919 -- Removed six.PY2/PY3 usage
Thanks Tim Graham for the review.
Diffstat (limited to 'tests/auth_tests/test_forms.py')
-rw-r--r--tests/auth_tests/test_forms.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/tests/auth_tests/test_forms.py b/tests/auth_tests/test_forms.py
index 36b4e8f4e7..c055b58042 100644
--- a/tests/auth_tests/test_forms.py
+++ b/tests/auth_tests/test_forms.py
@@ -1,6 +1,5 @@
import datetime
import re
-from unittest import skipIf
from django import forms
from django.contrib.auth.forms import (
@@ -15,7 +14,7 @@ from django.core import mail
from django.core.mail import EmailMultiAlternatives
from django.forms.fields import CharField, Field, IntegerField
from django.test import SimpleTestCase, TestCase, mock, override_settings
-from django.utils import six, translation
+from django.utils import translation
from django.utils.encoding import force_text
from django.utils.text import capfirst
from django.utils.translation import ugettext as _
@@ -114,14 +113,10 @@ class UserCreationFormTest(TestDataMixin, TestCase):
'password2': 'test123',
}
form = UserCreationForm(data)
- if six.PY3:
- self.assertTrue(form.is_valid())
- u = form.save()
- self.assertEqual(u.username, '宝')
- else:
- self.assertFalse(form.is_valid())
+ self.assertTrue(form.is_valid())
+ u = form.save()
+ self.assertEqual(u.username, '宝')
- @skipIf(six.PY2, "Python 2 doesn't support unicode usernames by default.")
def test_normalize_username(self):
# The normalization happens in AbstractBaseUser.clean() and ModelForm
# validation calls Model.clean().
@@ -137,7 +132,6 @@ class UserCreationFormTest(TestDataMixin, TestCase):
self.assertNotEqual(user.username, ohm_username)
self.assertEqual(user.username, 'testΩ') # U+03A9 GREEK CAPITAL LETTER OMEGA
- @skipIf(six.PY2, "Python 2 doesn't support unicode usernames by default.")
def test_duplicate_normalized_unicode(self):
"""
To prevent almost identical usernames, visually identical but differing