Add testing utilities for building Review expected queries.

Review Request #13415 — Created Nov. 15, 2023 and submitted — Latest diff uploaded

Information

Review Board
release-5.0.x

Reviewers

This introduces reviewboard.reviews.testing.queries.reviews, which
provides the following functions for building expected queries and
Q-expressions:

  • get_reviews_accessible_q()
  • get_reviews_accessible_equeries()
  • get_reviews_from_user_q()
  • get_reviews_from_user_equeries()

This covers all the queries made in ReviewManager, giving us what we
need for any unit tests that need to check accessible reviews.

The ReviewManager unit tests have been updated to use these,
simplifying that code considerably.

Unit tests pass.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Add testing utilities for building Review expected queries.
This introduces `reviewboard.reviews.testing.queries.reviews`, which provides the following functions for building expected queries and Q-expressions: * `get_reviews_accessible_q()` * `get_reviews_accessible_equeries()` * `get_reviews_from_user_q()` * `get_reviews_from_user_equeries()` This covers all the queries made in `ReviewManager`, giving us what we need for any unit tests that need to check accessible reviews. The `ReviewManager` unit tests have been updated to use these, simplifying that code considerably.
7008df12bc61c68aac623c31b0c26bc2e8ee51f8 Christian Hammond
docs/manual/extending/coderef/index.rst
reviewboard/reviews/testing/queries/reviews.py
reviewboard/reviews/tests/test_review_manager.py
Loading...