# Path: test_project/test_app/mixins.py
# class NoInvalidSlugsMixin(object):
#     def test_no_invalid_slugs(self):
#         self.assertEqual(Country.objects.filter(slug__startswith='invalid').count(), 0)
#         self.assertEqual(Region.objects.filter(slug__startswith='invalid').count(), 0)
#         self.assertEqual(Subregion.objects.filter(slug__startswith='invalid').count(), 0)
#         self.assertEqual(City.objects.filter(slug__startswith='invalid').count(), 0)
#         self.assertEqual(PostalCode.objects.filter(slug__startswith='invalid').count(), 0)
# 
# class ContinentsMixin(object):
#     num_continents = 7
# 
#     def setUp(self):
#         super(ContinentsMixin, self).setUp()
#         Continent.objects.all().delete()
#         add_continents(Continent)
# 
#     def test_num_continents(self):
#         self.assertEqual(Continent.objects.count(), self.num_continents)
# 
# Path: test_project/test_app/utils.py
# def reload_continent_data(signal, sender, setting, value, enter):
#     if setting != 'CITIES_CONTINENT_DATA':
#         return
# 
#     if value is None:
#         value = DEFAULT_CONTINENT_DATA
# 
#     # Force reload the conf value
#     sys.modules['cities.conf'].CONTINENT_DATA = value
#     sys.modules['cities.util'].CONTINENT_DATA = value


from django.test import TestCase, override_settings
from django.test.signals import setting_changed
from ..mixins import NoInvalidSlugsMixin, ContinentsMixin
from ..utils import reload_continent_data
    'OC': ('Oceania', 6255151),
    'SA': ('South America', 6255150),
    'AN': ('Antarctica', 6255152),
})
class EurasianContinentData(
        NoInvalidSlugsMixin, ContinentsMixin, TestCase):
    num_continents = 6


@override_settings(CITIES_CONTINENT_DATA={
    'AF': ('Africa', 6255146),
    'AS': ('Asia', 6255147),
    'EU': ('Europe', 6255148),
    'AM': ('America', 6255149),
    'OC': ('Oceania', 6255151),
    'AN': ('Antarctica', 6255152),
})
class AmericanContinentData(
        NoInvalidSlugsMixin, ContinentsMixin, TestCase):
    num_continents = 6


@override_settings(CITIES_CONTINENT_DATA={
    'AF': ('Africa', 6255146),
    'EA': ('Eurasia', 6255148),
    'NA': ('North America', 6255149),
    'OC': ('Oceania', 6255151),
    'SA': ('South America', 6255150),
})
class NoAntarcticaContinentData(

# Path: test_project/test_app/mixins.py
# class NoInvalidSlugsMixin(object):
#     def test_no_invalid_slugs(self):
#         self.assertEqual(Country.objects.filter(slug__startswith='invalid').count(), 0)
#         self.assertEqual(Region.objects.filter(slug__startswith='invalid').count(), 0)
#         self.assertEqual(Subregion.objects.filter(slug__startswith='invalid').count(), 0)
#         self.assertEqual(City.objects.filter(slug__startswith='invalid').count(), 0)
#         self.assertEqual(PostalCode.objects.filter(slug__startswith='invalid').count(), 0)
# 
# class ContinentsMixin(object):
#     num_continents = 7
# 
#     def setUp(self):
#         super(ContinentsMixin, self).setUp()
#         Continent.objects.all().delete()
#         add_continents(Continent)
# 
#     def test_num_continents(self):
#         self.assertEqual(Continent.objects.count(), self.num_continents)
# 
# Path: test_project/test_app/utils.py
# def reload_continent_data(signal, sender, setting, value, enter):
#     if setting != 'CITIES_CONTINENT_DATA':
#         return
# 
#     if value is None:
#         value = DEFAULT_CONTINENT_DATA
# 
#     # Force reload the conf value
#     sys.modules['cities.conf'].CONTINENT_DATA = value
#     sys.modules['cities.util'].CONTINENT_DATA = value


# Path: test_project/test_app/tests/test_custom_continent_data.py
from django.test import TestCase, override_settings
from django.test.signals import setting_changed
from ..mixins import NoInvalidSlugsMixin, ContinentsMixin
from ..utils import reload_continent_data

    'OC': ('Oceania', 6255151),
    'SA': ('South America', 6255150),
    'AN': ('Antarctica', 6255152),
})
class EurasianContinentData(
        NoInvalidSlugsMixin, ContinentsMixin, TestCase):
    num_continents = 6


@override_settings(CITIES_CONTINENT_DATA={
    'AF': ('Africa', 6255146),
    'AS': ('Asia', 6255147),
    'EU': ('Europe', 6255148),
    'AM': ('America', 6255149),
    'OC': ('Oceania', 6255151),
    'AN': ('Antarctica', 6255152),
})
class AmericanContinentData(
        NoInvalidSlugsMixin, ContinentsMixin, TestCase):
    num_continents = 6


@override_settings(CITIES_CONTINENT_DATA={
    'AF': ('Africa', 6255146),
    'EA': ('Eurasia', 6255148),
    'NA': ('North America', 6255149),
    'OC': ('Oceania', 6255151),
    'SA': ('South America', 6255150),
})
class NoAntarcticaContinentData(

        NoInvalidSlugsMixin, ContinentsMixin, TestCase):