summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2018-07-09 20:13:40 +0500
committerTim Graham <timograham@gmail.com>2018-07-09 11:13:40 -0400
commitc9088cfc7bdf035a2a28582f1be6acce1c30b8ef (patch)
tree6e111ae8821e629f044fd7d45fde20d4c0bcd186 /tests
parent3411c5551aa4ec141eb214f2928db4b077b41dd3 (diff)
Fixed some assertTrue() that were intended to be assertEqual().
Diffstat (limited to 'tests')
-rw-r--r--tests/model_inheritance/tests.py4
-rw-r--r--tests/queries/tests.py6
-rw-r--r--tests/utils_tests/test_encoding.py2
3 files changed, 6 insertions, 6 deletions
diff --git a/tests/model_inheritance/tests.py b/tests/model_inheritance/tests.py
index ad85a653d5..7ab75b6cc3 100644
--- a/tests/model_inheritance/tests.py
+++ b/tests/model_inheritance/tests.py
@@ -461,8 +461,8 @@ class InheritanceSameModelNameTests(SimpleTestCase):
ForeignReferent = Referent
self.assertFalse(hasattr(Referenced, related_name))
- self.assertTrue(Referenced.model_inheritance_referent_references.rel.model, LocalReferent)
- self.assertTrue(Referenced.tests_referent_references.rel.model, ForeignReferent)
+ self.assertIs(Referenced.model_inheritance_referent_references.field.model, LocalReferent)
+ self.assertIs(Referenced.tests_referent_references.field.model, ForeignReferent)
class InheritanceUniqueTests(TestCase):
diff --git a/tests/queries/tests.py b/tests/queries/tests.py
index c592086fd4..0d553c82d4 100644
--- a/tests/queries/tests.py
+++ b/tests/queries/tests.py
@@ -93,8 +93,8 @@ class Queries1Tests(TestCase):
self.assertEqual(qs4.query.subq_aliases, {'T', 'U', 'V'})
# It is possible to reuse U for the second subquery, no need to use W.
self.assertNotIn('w0', str(qs4.query).lower())
- # So, 'U0."id"' is referenced twice.
- self.assertTrue(str(qs4.query).lower().count('u0'), 2)
+ # So, 'U0."id"' is referenced in SELECT and WHERE twice.
+ self.assertEqual(str(qs4.query).lower().count('u0.'), 4)
def test_ticket1050(self):
self.assertQuerysetEqual(
@@ -511,7 +511,7 @@ class Queries1Tests(TestCase):
# This is also a good select_related() test because there are multiple
# Note entries in the SQL. The two Note items should be different.
- self.assertTrue(repr(qs[0].note), '<Note: n2>')
+ self.assertEqual(repr(qs[0].note), '<Note: n2>')
self.assertEqual(repr(qs[0].creator.extra.note), '<Note: n1>')
def test_ticket3037(self):
diff --git a/tests/utils_tests/test_encoding.py b/tests/utils_tests/test_encoding.py
index 614029ad12..c461df71ee 100644
--- a/tests/utils_tests/test_encoding.py
+++ b/tests/utils_tests/test_encoding.py
@@ -28,7 +28,7 @@ class TestEncodingUtils(SimpleTestCase):
def test_force_text_lazy(self):
s = SimpleLazyObject(lambda: 'x')
- self.assertTrue(type(force_text(s)), str)
+ self.assertIs(type(force_text(s)), str)
def test_force_text_DjangoUnicodeDecodeError(self):
msg = (