Fixed some assertTrue() that were intended to be assertEqual().
This commit is contained in:
parent
3411c5551a
commit
c9088cfc7b
|
@ -461,8 +461,8 @@ class InheritanceSameModelNameTests(SimpleTestCase):
|
||||||
ForeignReferent = Referent
|
ForeignReferent = Referent
|
||||||
|
|
||||||
self.assertFalse(hasattr(Referenced, related_name))
|
self.assertFalse(hasattr(Referenced, related_name))
|
||||||
self.assertTrue(Referenced.model_inheritance_referent_references.rel.model, LocalReferent)
|
self.assertIs(Referenced.model_inheritance_referent_references.field.model, LocalReferent)
|
||||||
self.assertTrue(Referenced.tests_referent_references.rel.model, ForeignReferent)
|
self.assertIs(Referenced.tests_referent_references.field.model, ForeignReferent)
|
||||||
|
|
||||||
|
|
||||||
class InheritanceUniqueTests(TestCase):
|
class InheritanceUniqueTests(TestCase):
|
||||||
|
|
|
@ -93,8 +93,8 @@ class Queries1Tests(TestCase):
|
||||||
self.assertEqual(qs4.query.subq_aliases, {'T', 'U', 'V'})
|
self.assertEqual(qs4.query.subq_aliases, {'T', 'U', 'V'})
|
||||||
# It is possible to reuse U for the second subquery, no need to use W.
|
# It is possible to reuse U for the second subquery, no need to use W.
|
||||||
self.assertNotIn('w0', str(qs4.query).lower())
|
self.assertNotIn('w0', str(qs4.query).lower())
|
||||||
# So, 'U0."id"' is referenced twice.
|
# So, 'U0."id"' is referenced in SELECT and WHERE twice.
|
||||||
self.assertTrue(str(qs4.query).lower().count('u0'), 2)
|
self.assertEqual(str(qs4.query).lower().count('u0.'), 4)
|
||||||
|
|
||||||
def test_ticket1050(self):
|
def test_ticket1050(self):
|
||||||
self.assertQuerysetEqual(
|
self.assertQuerysetEqual(
|
||||||
|
@ -511,7 +511,7 @@ class Queries1Tests(TestCase):
|
||||||
|
|
||||||
# This is also a good select_related() test because there are multiple
|
# This is also a good select_related() test because there are multiple
|
||||||
# Note entries in the SQL. The two Note items should be different.
|
# 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>')
|
self.assertEqual(repr(qs[0].creator.extra.note), '<Note: n1>')
|
||||||
|
|
||||||
def test_ticket3037(self):
|
def test_ticket3037(self):
|
||||||
|
|
|
@ -28,7 +28,7 @@ class TestEncodingUtils(SimpleTestCase):
|
||||||
|
|
||||||
def test_force_text_lazy(self):
|
def test_force_text_lazy(self):
|
||||||
s = SimpleLazyObject(lambda: 'x')
|
s = SimpleLazyObject(lambda: 'x')
|
||||||
self.assertTrue(type(force_text(s)), str)
|
self.assertIs(type(force_text(s)), str)
|
||||||
|
|
||||||
def test_force_text_DjangoUnicodeDecodeError(self):
|
def test_force_text_DjangoUnicodeDecodeError(self):
|
||||||
msg = (
|
msg = (
|
||||||
|
|
Loading…
Reference in New Issue