2021-08-06 18:29:01 +02:00
|
|
|
# standard imports
|
|
|
|
|
|
|
|
# external imports
|
|
|
|
|
2021-02-06 16:13:47 +01:00
|
|
|
# local imports
|
|
|
|
from cic_ussd.translation import translation_for
|
|
|
|
|
2021-08-06 18:29:01 +02:00
|
|
|
# tests imports
|
|
|
|
|
2021-02-06 16:13:47 +01:00
|
|
|
|
|
|
|
def test_translation_for(set_locale_files):
|
|
|
|
english_translation = translation_for(
|
2021-12-29 15:18:17 +01:00
|
|
|
key='ussd.exit_invalid_request',
|
2021-02-06 16:13:47 +01:00
|
|
|
preferred_language='en'
|
|
|
|
)
|
|
|
|
swahili_translation = translation_for(
|
2021-12-29 15:18:17 +01:00
|
|
|
key='ussd.exit_invalid_request',
|
2021-02-06 16:13:47 +01:00
|
|
|
preferred_language='sw'
|
|
|
|
)
|
|
|
|
assert swahili_translation == 'END Chaguo si sahihi.'
|
|
|
|
assert english_translation == 'END Invalid request.'
|