-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Niklaus Johner
committed
Oct 25, 2019
1 parent
8d6eaf3
commit 63407cb
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from ftw.testbrowser import browsing | ||
from opengever.testing import IntegrationTestCase | ||
|
||
|
||
class TestSchemaEndpoint(IntegrationTestCase): | ||
|
||
@browsing | ||
def test_schema_endpoint_id_for_vocabulary(self, browser): | ||
self.login(self.regular_user, browser) | ||
url = self.document.absolute_url() + '/@schema' | ||
response = browser.open( | ||
url, | ||
method='GET', | ||
headers=self.api_headers, | ||
).json | ||
expected_url = "/".join( | ||
(self.document.absolute_url(), | ||
'@vocabularies/classification_classification_vocabulary')) | ||
self.assertEqual( | ||
expected_url, | ||
response['properties']['classification']['vocabulary']['@id'] | ||
) | ||
|
||
@browsing | ||
def test_schema_endpoint_id_for_querysource(self, browser): | ||
self.login(self.regular_user, browser) | ||
url = self.document.absolute_url() + '/@schema' | ||
response = browser.open( | ||
url, | ||
method='GET', | ||
headers=self.api_headers, | ||
).json | ||
expected_url = "/".join( | ||
(self.document.absolute_url(), | ||
'@querysources/keywords')) | ||
self.assertEqual( | ||
expected_url, | ||
response['properties']['keywords']['items']['querysource']['@id'] | ||
) |