'Tests the iter_format_modules function.'

def test_iter_format_modules(self):

    activate('de-at')
    old_format_module_path = settings.FORMAT_MODULE_PATH
    try:
        settings.USE_L10N = True
        de_format_mod = import_module('django.conf.locale.de.formats')
        self.assertEqual(list(iter_format_modules('de')), [de_format_mod])
        settings.FORMAT_MODULE_PATH = 'regressiontests.i18n.other.locale'
        test_de_format_mod = import_module('regressiontests.i18n.other.locale.de.formats')
        self.assertEqual(list(iter_format_modules('de')), [test_de_format_mod, de_format_mod])
    finally:
        settings.FORMAT_MODULE_PATH = old_format_module_path
        deactivate()
