Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use six instead of try/except block

  • Loading branch information...
commit 1c7361e832733ab12b2380c594ea623265240c29 1 parent 2630a89
@vkurup vkurup authored
Showing with 2 additions and 9 deletions.
  1. +2 −9 test/generic/tests/test_filling_fields.py
View
11 test/generic/tests/test_filling_fields.py
@@ -23,7 +23,7 @@
pass
#BigIntegerField = IntegerField
-from six import text_type
+from six import text_type, string_types
from model_mommy import mommy
from test.generic.models import has_pil
@@ -36,13 +36,6 @@
from test.generic.models import DummyImageFieldModel
from test.generic.models import CustomFieldWithoutGeneratorModel, CustomFieldWithGeneratorModel
-try:
- unicode
-except NameError:
- # Python 3
- basestring = unicode = str
-
-
__all__ = [
'StringFieldsFilling', 'BooleanFieldsFilling', 'DateTimeFieldsFilling',
'DateFieldsFilling', 'FillingIntFields', 'FillingPositiveIntFields',
@@ -216,7 +209,7 @@ def test_filling_EmailField(self):
obj = mommy.make(DummyEmailModel)
field = DummyEmailModel._meta.get_field('email_field')
self.assertIsInstance(field, EmailField)
- self.assertIsInstance(obj.email_field, basestring)
+ self.assertIsInstance(obj.email_field, string_types)
class FillingGenericForeignKeyField(TestCase):
Please sign in to comment.
Something went wrong with that request. Please try again.