@override_settings(TRANSIFEX=TEST_TRANSIFEX_SETTINGS, DATA_REPOSITORY_DIR='/trans/repo')
def test_tx_upload_messages(self):
    language_code = 'es'
    legalcode = LegalCodeFactory(language_code=language_code)
    license = legalcode.license
    test_pofile = polib.POFile()
    with mock.patch.object(license, 'get_legalcode_for_language_code') as mock_glflc:
        mock_glflc.return_value = legalcode
        with mock.patch.object(TransifexHelper, 'upload_messages_to_transifex') as mock_umtt:
            with mock.patch.object(LegalCode, 'get_pofile') as mock_get_pofile:
                mock_get_pofile.return_value = test_pofile
                license.tx_upload_messages()
    mock_glflc.assert_called_with('en')
    mock_umtt.assert_called_with(legalcode=legalcode)
@override_settings(TRANSIFEX=TEST_TRANSIFEX_SETTINGS, DATA_REPOSITORY_DIR='/trans/repo')
def test_tx_upload_messages(self):
    language_code = 'es'
    legalcode = LegalCodeFactory(language_code=language_code)
    license = legalcode.license
    test_pofile = polib.POFile()
    with mock.patch.object(license, 'get_legalcode_for_language_code') as mock_glflc:
        mock_glflc.return_value = legalcode
        with mock.patch.object(TransifexHelper, 'upload_messages_to_transifex') as mock_umtt:
            with mock.patch.object(LegalCode, 'get_pofile') as mock_get_pofile:
                mock_get_pofile.return_value = test_pofile
                license.tx_upload_messages()
    mock_glflc.assert_called_with('en')
    mock_umtt.assert_called_with(legalcode=legalcode)