Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
folix-01 committed Jul 25, 2024
1 parent 6b590f7 commit f958752
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/collective/feedback/tests/test_feedbacks_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ def test_endpoint_returns_data(self):
now = datetime.now()
id = self.add_record(vote=1, comment="is ok", date=now)

transaction.commit()

response = self.api_session.get(self.url)
res = response.json()

Expand Down Expand Up @@ -160,6 +162,9 @@ def test_global_editor_can_see_all_data(self):
comment="ok also for restricted",
uid=self.restricted_document.UID(),
)

transaction.commit()

api_session = RelativeSession(self.portal_url)
api_session.headers.update({"Accept": "application/json"})
api_session.auth = ("global", "secret!!")
Expand All @@ -180,6 +185,9 @@ def test_local_editor_can_see_only_data_for_his_contents(self):
comment="ok also for restricted",
uid=self.restricted_document.UID(),
)

transaction.commit()

api_session = RelativeSession(self.portal_url)
api_session.headers.update({"Accept": "application/json"})
api_session.auth = ("local", "secret!!")
Expand All @@ -200,6 +208,8 @@ def test_only_admins_can_see_deleted_contents(self):
uid="qwertyuiop",
)

transaction.commit()

response = self.api_session.get(self.url)
res = response.json()
self.assertEqual(res["items_total"], 2)
Expand Down

0 comments on commit f958752

Please sign in to comment.