Esempio n. 1
0
def test_data_with_override_defined_locale(person_factory):
    with MimesisField.override_locale('en'):
        person = person_factory()

    for letter in person.full_name_en.replace(' ', ''):
        assert letter in string.ascii_letters

    for russian_letter in person.full_name_ru.replace(' ', ''):
        # Keyword locale has a priority over override:
        assert russian_letter not in string.ascii_letters
Esempio n. 2
0
def test_data_with_override_locale(person_factory):
    with MimesisField.override_locale('ru'):
        person = person_factory()

    for letter in person.full_name_en.replace(' ', ''):
        # Default locale will be changed to overridden:
        assert letter not in string.ascii_letters

    for russian_letter in person.full_name_ru.replace(' ', ''):
        assert russian_letter not in string.ascii_letters