summaryrefslogtreecommitdiff
path: root/tests/model_fields
diff options
context:
space:
mode:
authorJason Myers <jason@jasonamyers.com>2013-11-02 23:36:09 -0500
committerJason Myers <jason@jasonamyers.com>2013-11-02 23:50:49 -0500
commit7a61c68c50d3837c50e35c252fd76220f08b5290 (patch)
tree586f16a3f02c2b45ffb3dd2af834c0ef604e099c /tests/model_fields
parent0fdb692c6c94d912f17a3e2ad12413fb072d38ec (diff)
PEP8 cleanup
Signed-off-by: Jason Myers <jason@jasonamyers.com>
Diffstat (limited to 'tests/model_fields')
-rw-r--r--tests/model_fields/tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/model_fields/tests.py b/tests/model_fields/tests.py
index f3ef83a39c..d78f3d7c2d 100644
--- a/tests/model_fields/tests.py
+++ b/tests/model_fields/tests.py
@@ -133,6 +133,7 @@ class DecimalFieldTests(test.TestCase):
# This should not crash. That counts as a win for our purposes.
Foo.objects.filter(d__gte=100000000000)
+
class ForeignKeyTests(test.TestCase):
def test_callable_default(self):
"""Test the use of a lazy callable for ForeignKey.default"""
@@ -140,6 +141,7 @@ class ForeignKeyTests(test.TestCase):
b = Bar.objects.create(b="bcd")
self.assertEqual(b.a, a)
+
class DateTimeFieldTests(unittest.TestCase):
def test_datetimefield_to_python_usecs(self):
"""DateTimeField.to_python should support usecs"""
@@ -157,6 +159,7 @@ class DateTimeFieldTests(unittest.TestCase):
self.assertEqual(f.to_python('01:02:03.999999'),
datetime.time(1, 2, 3, 999999))
+
class BooleanFieldTests(unittest.TestCase):
def _test_get_db_prep_lookup(self, f):
from django.db import connection
@@ -294,6 +297,7 @@ class BooleanFieldTests(unittest.TestCase):
self.assertIsNone(nb.nbfield)
nb.save() # no error
+
class ChoicesTests(test.TestCase):
def test_choices_and_field_display(self):
"""
@@ -306,6 +310,7 @@ class ChoicesTests(test.TestCase):
self.assertEqual(Whiz(c=None).get_c_display(), None) # Blank value
self.assertEqual(Whiz(c='').get_c_display(), '') # Empty value
+
class SlugFieldTests(test.TestCase):
def test_slugfield_max_length(self):
"""
@@ -409,6 +414,7 @@ class BigIntegerFieldTests(test.TestCase):
b = BigInt.objects.get(value='10')
self.assertEqual(b.value, 10)
+
class TypeCoercionTests(test.TestCase):
"""
Test that database lookups can accept the wrong types and convert
@@ -422,6 +428,7 @@ class TypeCoercionTests(test.TestCase):
def test_lookup_integer_in_textfield(self):
self.assertEqual(Post.objects.filter(body=24).count(), 0)
+
class FileFieldTests(unittest.TestCase):
def test_clearable(self):
"""
@@ -496,6 +503,7 @@ class BinaryFieldTests(test.TestCase):
dm = DataModel(short_data=self.binary_data * 4)
self.assertRaises(ValidationError, dm.full_clean)
+
class GenericIPAddressFieldTests(test.TestCase):
def test_genericipaddressfield_formfield_protocol(self):
"""