Skip to content

Commit

Permalink
Merge PR OCA#826 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by LoisRForgeFlow
  • Loading branch information
OCA-git-bot committed Feb 15, 2024
2 parents eda84e2 + ed9c449 commit 27ed8e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 0 additions & 2 deletions base_tier_validation/models/tier_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,6 @@ def _validate_tier(self, tiers=False):
waiting_reviews.write(
{
"status": "pending",
"done_by": self.env.user.id,
"reviewed_date": fields.Datetime.now(),
}
)

Expand Down
10 changes: 10 additions & 0 deletions base_tier_validation/tests/test_tier_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,8 @@ def test_15_review_user_count(self):
self.assertEqual(len(count), 1)
# False Review
self.assertFalse(self.test_record._calc_reviews_validated(False))
# test notification message bodies
self.assertIn("created", self.test_record._notify_created_review_body())
self.assertIn("requested", self.test_record._notify_requested_review_body())
self.assertIn("rejected", self.test_record._notify_rejected_review_body())
self.assertIn("accepted", self.test_record._notify_accepted_reviews_body())
Expand Down Expand Up @@ -514,12 +516,20 @@ def test_19_waiting_tier(self):
# first reviewer does not want notifications
# chatter should be empty
self.assertFalse(test_record.message_ids)
self.assertTrue(review_1.done_by.id is False)
self.assertTrue(review_1.reviewed_date is False)
self.assertTrue(review_2.status == "waiting")
self.assertTrue(review_2.done_by.id is False)
self.assertTrue(review_2.reviewed_date is False)
record = test_record.with_user(self.test_user_1.id)
record.invalidate_model()
record.validate_tier()
self.assertTrue(review_1.status == "approved")
self.assertFalse(review_1.reviewed_date is False)
self.assertTrue(review_1.done_by.id == self.test_user_1.id)
self.assertTrue(review_2.status == "pending")
self.assertTrue(review_2.done_by.id is False)
self.assertTrue(review_2.reviewed_date is False)

def test_20_no_sequence(self):
# Create new test record
Expand Down

0 comments on commit 27ed8e5

Please sign in to comment.