コード例 #1
0
ファイル: test_regions.py プロジェクト: Fjoerfoks/zamboni
 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'])
コード例 #2
0
ファイル: test_regions.py プロジェクト: wangeek/zamboni
 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'])
コード例 #3
0
 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])
コード例 #4
0
ファイル: tests.py プロジェクト: diox/marketplace-constants
 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])
コード例 #5
0
 def test_valid(self):
     diff = set(COUNTRY_DETAILS.keys()).difference(set(COUNTRIES))
     assert not diff, 'Extra countries: %s' % diff
コード例 #6
0
 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])
コード例 #7
0
ファイル: tests.py プロジェクト: diox/marketplace-constants
 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']))
コード例 #8
0
ファイル: tests.py プロジェクト: diox/marketplace-constants
 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])
コード例 #9
0
ファイル: tests.py プロジェクト: diox/marketplace-constants
 def test_valid(self):
     diff = set(COUNTRY_DETAILS.keys()).difference(set(COUNTRIES))
     assert not diff, 'Extra countries: %s' % diff
コード例 #10
0
ファイル: test_regions.py プロジェクト: kolyaflash/zamboni
 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)), [])
コード例 #11
0
 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)), [])