diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2011-03-03 15:04:39 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2011-03-03 15:04:39 +0000 |
| commit | afd040d4d3a06fe92e3080870b2ff2095ce86a75 (patch) | |
| tree | bda969614999a3fcfbf1466caa0d75e512dd1374 /tests/modeltests/raw_query | |
| parent | b7c41c1fbb2d45634dde5f7a450ba1a5aea5a8af (diff) | |
Updated test assertions that have been deprecated by the move to unittest2. In summary, this means:
assert_ -> assertTrue
assertEquals -> assertEqual
failUnless -> assertTrue
For full details, see http://www.voidspace.org.uk/python/articles/unittest2.shtml#deprecations
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15728 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/modeltests/raw_query')
| -rw-r--r-- | tests/modeltests/raw_query/tests.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/modeltests/raw_query/tests.py b/tests/modeltests/raw_query/tests.py index e7cadfae8c..5334412680 100644 --- a/tests/modeltests/raw_query/tests.py +++ b/tests/modeltests/raw_query/tests.py @@ -30,10 +30,10 @@ class RawQueryTests(TestCase): for field in model._meta.fields: # Check that all values on the model are equal - self.assertEquals(getattr(item,field.attname), + self.assertEqual(getattr(item,field.attname), getattr(orig_item,field.attname)) # This includes checking that they are the same type - self.assertEquals(type(getattr(item,field.attname)), + self.assertEqual(type(getattr(item,field.attname)), type(getattr(orig_item,field.attname))) def assertNoAnnotations(self, results): @@ -67,9 +67,9 @@ class RawQueryTests(TestCase): iterated over. """ q = Author.objects.raw('SELECT * FROM raw_query_author') - self.assert_(q.query.cursor is None) + self.assertTrue(q.query.cursor is None) list(q) - self.assert_(q.query.cursor is not None) + self.assertTrue(q.query.cursor is not None) def testFkeyRawQuery(self): """ @@ -204,7 +204,7 @@ class RawQueryTests(TestCase): self.assertEqual(third_author.first_name, 'Bob') first_two = Author.objects.raw(query)[0:2] - self.assertEquals(len(first_two), 2) + self.assertEqual(len(first_two), 2) self.assertRaises(TypeError, lambda: Author.objects.raw(query)['test']) |
