'Tests for the released languages.'

@ddt.data(*[('en', [], [], []), ('en', [EN], [], [EN]), ('en', [EN, ES_419], [], [EN]), ('en', [EN, ES_419], ['es-419'], [EN, ES_419]), ('es-419', [EN, ES_419], ['es-419'], [ES_419]), ('en', [EN, ES_419], ['es'], [EN])])
@ddt.unpack
def test_released_languages(self, default_lang, languages, dark_lang_released, expected_languages):

    with override_settings(LANGUAGES=languages, LANGUAGE_CODE=default_lang):
        user = User()
        user.save()
        DarkLangConfig(released_languages=',    '.join(dark_lang_released), changed_by=user, enabled=True).save()
        released_languages = language_api.released_languages()
        self.assertEqual(released_languages, expected_languages)
