def test_no_missing_region(self): """Test that we haven't forgotten to add some regions to the lookup dictionary.""" defined_regions = regions.REGION_LOOKUP.keys() available_regions = {c['slug'] for c in COUNTRY_DETAILS.values()} # China *should* be missing, it's no longer available for submission. eq_(list(available_regions.difference(defined_regions)), ['cn'])
def test_unique_mccs(self): # So far, our MCCs have always been unique (and so it's helpful to have # this test to detect copy-pasting errors) but it might not be the # case in the future. Delete this test if you find out it's actually # wrong. ids = filter(None, [c.get('mcc') for c in COUNTRY_DETAILS.values()]) most = Counter(ids).most_common(1)[0] assert most[1] == 1, 'Id: %s occurred %s times' % (most[0], most[1])
def test_unique_mcs(self): # So far, our MCCs have always been unique (and so it's helpful to have # this test to detect copy-pasting errors) but it might not be the # case in the future. Delete this test if you find out it's actually # wrong. ids = [c['mcc'] for c in COUNTRY_DETAILS.values()] most = Counter(ids).most_common(1)[0] assert most[1] == 1, 'Id: %s occurred %s times' % (most[0], most[1])
def test_unique_slugs(self): ids = [c['slug'] for c in COUNTRY_DETAILS.values()] most = Counter(ids).most_common(1)[0] assert most[1] == 1, 'Id: %s occurred %s times' % (most[0], most[1])
def test_valid_currency(self): for country in COUNTRY_DETAILS.values(): assert country['default_currency'] in CURRENCIES, ( 'Country %s has an unkown default currency: %s' % (country['name'], country['default_currency']))
def test_no_missing_region(self): """Test that we haven't forgotten to add some regions to the lookup dictionary.""" defined_regions = regions.REGION_LOOKUP.keys() available_regions = {c['slug'] for c in COUNTRY_DETAILS.values()} eq_(list(available_regions.difference(defined_regions)), [])