Fixed #23620 -- Used more specific assertions in the Django test suite.

This commit is contained in:
Berker Peksag 2014-10-28 12:02:56 +02:00 committed by Tim Graham
parent c0c78f1b70
commit f7969b0920
83 changed files with 419 additions and 429 deletions

View file

@ -392,7 +392,7 @@ class SequenceResetTest(TestCase):
# If we create a new object now, it should have a PK greater
# than the PK we specified manually.
obj = models.Post.objects.create(name='New post', text='goodbye world')
self.assertTrue(obj.pk > 10)
self.assertGreater(obj.pk, 10)
# This test needs to run outside of a transaction, otherwise closing the
@ -413,12 +413,12 @@ class ConnectionCreatedSignalTest(TransactionTestCase):
connection_created.connect(receiver)
connection.close()
connection.cursor()
self.assertTrue(data["connection"].connection is connection.connection)
self.assertIs(data["connection"].connection, connection.connection)
connection_created.disconnect(receiver)
data.clear()
connection.cursor()
self.assertTrue(data == {})
self.assertEqual(data, {})
class EscapingChecks(TestCase):