diff --git a/tests/fields/file_tests.py b/tests/fields/file_tests.py index ba601dea..902b1512 100644 --- a/tests/fields/file_tests.py +++ b/tests/fields/file_tests.py @@ -279,7 +279,7 @@ class FileTest(unittest.TestCase): t.image.put(f) self.fail("Should have raised an invalidation error") except ValidationError, e: - self.assertEquals("%s" % e, "Invalid image: cannot identify image file") + self.assertEqual("%s" % e, "Invalid image: cannot identify image file") t = TestImage() t.image.put(open(TEST_IMAGE_PATH, 'rb')) diff --git a/tests/queryset/geo.py b/tests/queryset/geo.py index 62e1f668..65ab519a 100644 --- a/tests/queryset/geo.py +++ b/tests/queryset/geo.py @@ -422,11 +422,11 @@ class GeoQueriesTest(unittest.TestCase): Location(loc=[1,2]).save() loc = Location.objects.as_pymongo()[0] - self.assertEquals(loc["loc"], {"type": "Point", "coordinates": [1, 2]}) + self.assertEqual(loc["loc"], {"type": "Point", "coordinates": [1, 2]}) Location.objects.update(set__loc=[2,1]) loc = Location.objects.as_pymongo()[0] - self.assertEquals(loc["loc"], {"type": "Point", "coordinates": [2, 1]}) + self.assertEqual(loc["loc"], {"type": "Point", "coordinates": [2, 1]}) def test_2dsphere_linestring_sets_correctly(self): class Location(Document): @@ -436,11 +436,11 @@ class GeoQueriesTest(unittest.TestCase): Location(line=[[1, 2], [2, 2]]).save() loc = Location.objects.as_pymongo()[0] - self.assertEquals(loc["line"], {"type": "LineString", "coordinates": [[1, 2], [2, 2]]}) + self.assertEqual(loc["line"], {"type": "LineString", "coordinates": [[1, 2], [2, 2]]}) Location.objects.update(set__line=[[2, 1], [1, 2]]) loc = Location.objects.as_pymongo()[0] - self.assertEquals(loc["line"], {"type": "LineString", "coordinates": [[2, 1], [1, 2]]}) + self.assertEqual(loc["line"], {"type": "LineString", "coordinates": [[2, 1], [1, 2]]}) def test_geojson_PolygonField(self): class Location(Document): @@ -450,11 +450,11 @@ class GeoQueriesTest(unittest.TestCase): Location(poly=[[[40, 5], [40, 6], [41, 6], [40, 5]]]).save() loc = Location.objects.as_pymongo()[0] - self.assertEquals(loc["poly"], {"type": "Polygon", "coordinates": [[[40, 5], [40, 6], [41, 6], [40, 5]]]}) + self.assertEqual(loc["poly"], {"type": "Polygon", "coordinates": [[[40, 5], [40, 6], [41, 6], [40, 5]]]}) Location.objects.update(set__poly=[[[40, 4], [40, 6], [41, 6], [40, 4]]]) loc = Location.objects.as_pymongo()[0] - self.assertEquals(loc["poly"], {"type": "Polygon", "coordinates": [[[40, 4], [40, 6], [41, 6], [40, 4]]]}) + self.assertEqual(loc["poly"], {"type": "Polygon", "coordinates": [[[40, 4], [40, 6], [41, 6], [40, 4]]]}) if __name__ == '__main__': unittest.main() diff --git a/tests/queryset/queryset.py b/tests/queryset/queryset.py index d09f19cd..de39ee10 100644 --- a/tests/queryset/queryset.py +++ b/tests/queryset/queryset.py @@ -2538,7 +2538,7 @@ class QuerySetTest(unittest.TestCase): book = Book(title="The Stories", authors=[mark_twain, john_tolkien]).save() authors = Book.objects.distinct("authors") - self.assertEquals(authors, [mark_twain, john_tolkien]) + self.assertEqual(authors, [mark_twain, john_tolkien]) def test_custom_manager(self): """Ensure that custom QuerySetManager instances work as expected. @@ -3641,9 +3641,9 @@ class QuerySetTest(unittest.TestCase): docs = Noddy.objects.no_cache() counter = len([1 for i in docs]) - self.assertEquals(counter, 100) + self.assertEqual(counter, 100) - self.assertEquals(len(list(docs)), 100) + self.assertEqual(len(list(docs)), 100) self.assertRaises(TypeError, lambda: len(docs)) with query_counter() as q: diff --git a/tests/queryset/transform.py b/tests/queryset/transform.py index 2ca67222..48e01919 100644 --- a/tests/queryset/transform.py +++ b/tests/queryset/transform.py @@ -172,30 +172,30 @@ class TransformTest(unittest.TestCase): loc = PointField() update = transform.update(Location, set__loc=[1, 2]) - self.assertEquals(update, {'$set': {'loc': {"type": "Point", "coordinates": [1,2]}}}) + self.assertEqual(update, {'$set': {'loc': {"type": "Point", "coordinates": [1,2]}}}) update = transform.update(Location, set__loc={"type": "Point", "coordinates": [1,2]}) - self.assertEquals(update, {'$set': {'loc': {"type": "Point", "coordinates": [1,2]}}}) + self.assertEqual(update, {'$set': {'loc': {"type": "Point", "coordinates": [1,2]}}}) def test_geojson_LineStringField(self): class Location(Document): line = LineStringField() update = transform.update(Location, set__line=[[1, 2], [2, 2]]) - self.assertEquals(update, {'$set': {'line': {"type": "LineString", "coordinates": [[1, 2], [2, 2]]}}}) + self.assertEqual(update, {'$set': {'line': {"type": "LineString", "coordinates": [[1, 2], [2, 2]]}}}) update = transform.update(Location, set__line={"type": "LineString", "coordinates": [[1, 2], [2, 2]]}) - self.assertEquals(update, {'$set': {'line': {"type": "LineString", "coordinates": [[1, 2], [2, 2]]}}}) + self.assertEqual(update, {'$set': {'line': {"type": "LineString", "coordinates": [[1, 2], [2, 2]]}}}) def test_geojson_PolygonField(self): class Location(Document): poly = PolygonField() update = transform.update(Location, set__poly=[[[40, 5], [40, 6], [41, 6], [40, 5]]]) - self.assertEquals(update, {'$set': {'poly': {"type": "Polygon", "coordinates": [[[40, 5], [40, 6], [41, 6], [40, 5]]]}}}) + self.assertEqual(update, {'$set': {'poly': {"type": "Polygon", "coordinates": [[[40, 5], [40, 6], [41, 6], [40, 5]]]}}}) update = transform.update(Location, set__poly={"type": "Polygon", "coordinates": [[[40, 5], [40, 6], [41, 6], [40, 5]]]}) - self.assertEquals(update, {'$set': {'poly': {"type": "Polygon", "coordinates": [[[40, 5], [40, 6], [41, 6], [40, 5]]]}}}) + self.assertEqual(update, {'$set': {'poly': {"type": "Polygon", "coordinates": [[[40, 5], [40, 6], [41, 6], [40, 5]]]}}}) if __name__ == '__main__': unittest.main()