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 f958752 commit ddd9374
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/collective/feedback/tests/test_feedbacks_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ def add_record(self, date=None, vote="", uid="", comment="", title=""):
record.attrs["uid"] = uid
if title:
record.attrs["title"] = title
return soup.add(record)

transaction.commit()

return soup.add(record)

def setUp(self):
self.app = self.layer["app"]
self.portal = self.layer["portal"]
Expand Down Expand Up @@ -117,8 +119,6 @@ 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 @@ -163,8 +163,6 @@ def test_global_editor_can_see_all_data(self):
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 @@ -186,8 +184,6 @@ def test_local_editor_can_see_only_data_for_his_contents(self):
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 @@ -208,8 +204,6 @@ 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 ddd9374

Please sign in to comment.