integreat-cms
integreat-cms copied to clipboard
Expand MT test for Google Translate
Short description
This PR expands machine translation related tests for Google Translate.
Proposed changes
- Add test to check MT provider assignment
- Add Google Translate to tests of MT bulk action and MT per content form etc, by which so far only DeepL was tested.
- Patch initialization of
GoogleTranslateApiClient
to bipass the authentication with credentials and use a fake client - Add rough
try
andexcept
totranslate_queryset
of Google Translate API to prevent such problems like #2280 (This can be improved later upon request). - Add/change some test data, adjust expected outputs affected by the changed test data and comments in the test code
- Some clean up (I hope this way brings better overview to you too)
Side effects
- None? 🙈
Resolved issues
Fixes: #2641 (patially #2582)
Code Climate has analyzed commit 4e621da8 and detected 0 issues on this pull request.
The test coverage on the diff in this pull request is 89.4% (50% is the threshold).
This pull request will bring the total coverage in the repository to 82.2% (0.5% change).
View more on Code Climate.
@david-venhoff Thank you for suggestions 😸 The setup lines are bundled into a function, and duplicates of MT bulkaction test and form translation tests are removed.
@david-venhoff Thank you so much for detailed regiew and a lot of help🥺 🙏