MCPcopy
hub / github.com/django/django / test_country

Method test_country

tests/gis_tests/test_geoip2.py:124–136  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

122 function(value)
123
124 def test_country(self):
125 g = GeoIP2(city="<invalid>")
126 self.assertIs(g.is_city, False)
127 self.assertIs(g.is_country, True)
128 for query in self.query_values:
129 with self.subTest(query=query):
130 self.assertEqual(g.country(query), self.expected_country)
131 self.assertEqual(
132 g.country_code(query), self.expected_country["country_code"]
133 )
134 self.assertEqual(
135 g.country_name(query), self.expected_country["country_name"]
136 )
137
138 def test_country_using_city_database(self):
139 g = GeoIP2(country="<invalid>")

Callers

nothing calls this directly

Calls 4

countryMethod · 0.95
country_codeMethod · 0.95
country_nameMethod · 0.95
GeoIP2Class · 0.90

Tested by

no test coverage detected