def test_cell_geoip_mismatch(self): # UK GeoIP with US mcc cell = CellFactory.create(mcc=310) query = self.model_query(cells=[cell]) res = self._call(body=query, ip=self.test_ip) self.check_model_response(res, cell, country='US') self.check_db_calls(rw=0, ro=0)
def test_cell_ambiguous(self): # cell with ambiguous mcc to country mapping cell = CellFactory.create(mcc=234) query = self.model_query(cells=[cell]) res = self._call(body=query) self.check_model_response(res, cell, country='GB') self.check_db_calls(rw=0, ro=0)
def test_cell(self): # cell with unique mcc to region mapping cell = CellFactory.create(mcc=235) query = self.model_query(cells=[cell]) res = self._call(body=query) self.check_model_response(res, cell, region='GB') self.check_db_calls(rw=0, ro=0)
def test_cell(self): # create a cell in the UK cell = CellFactory.create(mcc=235) query = self.model_query(cells=[cell]) res = self._call(body=query) self.check_model_response(res, cell, country='GB') self.check_db_calls(rw=0, ro=0) self.check_stats( counter=[self.metric + '.cell_hit'])