Skip to content

Commit

Permalink
Refs #1001 - Make tests more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
avoinea committed Oct 2, 2020
1 parent e8b3e9c commit 4bca687
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions news/1001.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Update tests to fix https://github.com/plone/plone.dexterity/pull/137
[@avoinea]
14 changes: 8 additions & 6 deletions src/plone/restapi/tests/test_services_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ def test_types_document_get_field(self):
self.assertEqual(
"Email of the author", response.json().get("description")
) # noqa
self.assertEqual(
"plone.dexterity.schema.generated.plone_0_Document",
response.json().get("behavior"),
self.assertTrue(
response.json()
.get("behavior")
.startswith("plone.dexterity.schema.generated.plone_")
) # noqa
self.assertEqual("string", response.json().get("type"))
self.assertEqual("email", response.json().get("widget"))
Expand Down Expand Up @@ -169,9 +170,10 @@ def test_types_document_post_field(self):
self.assertEqual(response.status_code, 201)
self.assertEqual("Email", response.json().get("title"))
self.assertEqual("Foo bar email", response.json().get("description"))
self.assertEqual(
"plone.dexterity.schema.generated.plone_0_Document",
response.json().get("behavior"),
self.assertTrue(
response.json()
.get("behavior")
.startswith("plone.dexterity.schema.generated.plone_")
) # noqa
self.assertEqual("string", response.json().get("type"))
self.assertEqual("email", response.json().get("widget"))
Expand Down

0 comments on commit 4bca687

Please sign in to comment.