예제 #1
0
def translation_a(locale_a, project_locale_a, entity_a, user_a):
    '''Return a translation.

    Note that we require the `project_locale_a` fixture because a
    valid ProjectLocale is needed in order to query Translations.

    '''
    return factories.TranslationFactory(
        entity=entity_a,
        locale=locale_a,
        user=user_a,
        string='Translation for entity_a',
    )
예제 #2
0
def translation_a(locale_a, project_locale_a, entity_a, user_a):
    """Return a translation.

    Note that we require the `project_locale_a` fixture because a
    valid ProjectLocale is needed in order to query Translations.
    """
    translation_a = factories.TranslationFactory(
        entity=entity_a,
        locale=locale_a,
        user=user_a,
        string='Translation for entity_a',
    )
    translation_a.locale.refresh_from_db()
    translation_a.entity.resource.project.refresh_from_db()
    return translation_a