1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #24714 -- Used more specific assertions than assertEqual in tests.

This commit is contained in:
Alasdair Nicol
2015-04-27 15:59:16 +01:00
committed by Tim Graham
parent 3b133ffb8b
commit eaeea6f947
17 changed files with 83 additions and 82 deletions

View File

@@ -32,16 +32,16 @@ class GeoIPTest(unittest.TestCase):
g3 = GeoIP.open(path, 0) # MaxMind Python API syntax.
for g in (g1, g2, g3):
self.assertEqual(True, bool(g._country))
self.assertEqual(True, bool(g._city))
self.assertTrue(g._country)
self.assertTrue(g._city)
# Only passing in the location of one database.
city = os.path.join(path, 'GeoLiteCity.dat')
cntry = os.path.join(path, 'GeoIP.dat')
g4 = GeoIP(city, country='')
self.assertEqual(None, g4._country)
self.assertIsNone(g4._country)
g5 = GeoIP(cntry, city='')
self.assertEqual(None, g5._city)
self.assertIsNone(g5._city)
# Improper parameters.
bad_params = (23, 'foo', 15.23)