diff --git a/src/collective/feedback/tests/test_feedbacks_get.py b/src/collective/feedback/tests/test_feedbacks_get.py index 193940a..902089f 100644 --- a/src/collective/feedback/tests/test_feedbacks_get.py +++ b/src/collective/feedback/tests/test_feedbacks_get.py @@ -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"] @@ -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() @@ -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!!") @@ -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!!") @@ -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)