def test_only_code(self):
     """GeoIP code is included when the country name is missing."""
     req = RequestFactory()
     req.COOKIES = {
         'geoip_country_code': 'US',
     }
     val = geoip_cache_detector(req)
     eq_(val['include_geoip'], True)
 def test_only_code(self):
     """GeoIP code is included when the country name is missing."""
     req = RequestFactory()
     req.COOKIES = {
         'geoip_country_code': 'US',
     }
     val = geoip_cache_detector(req)
     eq_(val['include_geoip'], True)
 def test_when_both(self):
     """GeoIP code is not included when both name and code already exist."""
     req = RequestFactory()
     req.COOKIES = {
         'geoip_country_name': 'United States',
         'geoip_country_code': 'US',
     }
     val = geoip_cache_detector(req)
     eq_(val['include_geoip'], False)
 def test_when_both(self):
     """GeoIP code is not included when both name and code already exist."""
     req = RequestFactory()
     req.COOKIES = {
         'geoip_country_name': 'United States',
         'geoip_country_code': 'US',
     }
     val = geoip_cache_detector(req)
     eq_(val['include_geoip'], False)