import importlib

from django.test import TestCase


class SettingsTest(TestCase):
    def test_flatpages_has_not_moved_in_oscar_settings(self):
        "The flatpages setting should be in the same spot in oscar defaults"
        # load defaults and make sure it hasn;t been tampered with
        defaults = importlib.import_module("oscar.defaults")
        importlib.reload(defaults)
        self.assertEqual(
            defaults.OSCAR_DASHBOARD_NAVIGATION[5]["children"][0]["url_name"],
            "dashboard:page-list",
            "dashboard pages should be at this spot in the dashboard nav %s"
            % defaults.OSCAR_DASHBOARD_NAVIGATION,
        )
