def test_get_revision_number(self): """Test to get the revision number of a revision of a specified review.""" rev_num = revision.get_revision_number(self.review.id, self.review.last_revision.id) self.assertEqual(rev_num, 1) self.review.update(text="Updated this review") rev_num = revision.get_revision_number(self.review.id, self.review.last_revision.id) self.assertEqual(rev_num, 2)
def test_get_revision_number(self): """Test to get the revision number of a revision of a specified review.""" rev_num = revision.get_revision_number(self.review["id"], self.review["last_revision"]["id"]) self.assertEqual(rev_num, 1) db_review.update( review_id=self.review["id"], drafted=self.review["is_draft"], text="Updated this review", ) self.review = db_review.get_by_id(self.review["id"]) rev_num = revision.get_revision_number(self.review["id"], self.review["last_revision"]["id"]) self.assertEqual(rev_num, 2)
def test_get_revision_number(self): """Test to get the revision number of a revision of a specified review.""" rev_num = revision.get_revision_number( self.review["id"], self.review["last_revision"]["id"]) self.assertEqual(rev_num, 1) db_review.update( review_id=self.review["id"], drafted=self.review["is_draft"], text="Updated this review", ) self.review = db_review.get_by_id(self.review["id"]) rev_num = revision.get_revision_number( self.review["id"], self.review["last_revision"]["id"]) self.assertEqual(rev_num, 2)
def redirect_to_entity(review_id, revision_id): try: revision_number = db_revision.get_revision_number( review_id, revision_id) except db_exceptions.NoDataFoundException: raise NotFound( gettext("The revision you are looking for does not exist.")) return redirect(url_for('.entity', id=review_id, rev=revision_number))