mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-18 00:54:27 +03:00
Simplify by using method _get_reviews
This commit is contained in:
parent
6a70e9bd44
commit
bb0c54e3df
@ -527,12 +527,9 @@ class TestHttpReview(BaseTestHttp):
|
|||||||
assert response_json["success"] == True
|
assert response_json["success"] == True
|
||||||
assert response_json["message"] == "Delete reviews"
|
assert response_json["message"] == "Delete reviews"
|
||||||
# Verify that in DB the review segment was not deleted
|
# Verify that in DB the review segment was not deleted
|
||||||
review_segment_in_db = (
|
review_ids_in_db_after = self._get_reviews([id])
|
||||||
ReviewSegment.select(ReviewSegment.id)
|
assert len(review_ids_in_db_after) == 1
|
||||||
.where(ReviewSegment.id == id)
|
assert review_ids_in_db_after[0].id == id
|
||||||
.get()
|
|
||||||
)
|
|
||||||
assert review_segment_in_db.id == id
|
|
||||||
|
|
||||||
def test_post_reviews_delete(self):
|
def test_post_reviews_delete(self):
|
||||||
with TestClient(self.app) as client:
|
with TestClient(self.app) as client:
|
||||||
@ -545,12 +542,8 @@ class TestHttpReview(BaseTestHttp):
|
|||||||
assert response_json["success"] == True
|
assert response_json["success"] == True
|
||||||
assert response_json["message"] == "Delete reviews"
|
assert response_json["message"] == "Delete reviews"
|
||||||
# Verify that in DB the review segment was deleted
|
# Verify that in DB the review segment was deleted
|
||||||
review_segment_in_db = (
|
review_ids_in_db_after = self._get_reviews([id])
|
||||||
ReviewSegment.select(ReviewSegment.id)
|
assert len(review_ids_in_db_after) == 0
|
||||||
.where(ReviewSegment.id == id)
|
|
||||||
.get_or_none()
|
|
||||||
)
|
|
||||||
assert review_segment_in_db == None
|
|
||||||
|
|
||||||
def test_post_reviews_delete_many(self):
|
def test_post_reviews_delete_many(self):
|
||||||
with TestClient(self.app) as client:
|
with TestClient(self.app) as client:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user