integreat-cms icon indicating copy to clipboard operation
integreat-cms copied to clipboard

Expand MT test for Google Translate

Open MizukiTemma opened this issue 11 months ago • 2 comments

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 and except to translate_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)


Pull Request Review Guidelines

MizukiTemma avatar Mar 11 '24 16:03 MizukiTemma

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.

codeclimate[bot] avatar Mar 11 '24 16:03 codeclimate[bot]

@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.

MizukiTemma avatar Apr 08 '24 13:04 MizukiTemma

@david-venhoff Thank you so much for detailed regiew and a lot of help🥺 🙏

MizukiTemma avatar Apr 22 '24 14:04 MizukiTemma