Commit c496aefd authored by Łukasz Nowak's avatar Łukasz Nowak

Check that OPTIONS on /instance are available for anonymous.

parent 91a9efcd
......@@ -113,6 +113,9 @@ class TestVifibSlaposRestAPIV1(ERP5TypeTestCase):
self.assertEqual(self.response.getheader('Content-Type'), 'application/json')
self.json_response = json.loads(self.response_data)
def assertResponseNoContentType(self):
self.assertEqual(self.response.getheader('Content-Type'), None)
def assertSimulatorEmpty(self):
self.assertEqual(open(self.simulator).read(), '')
......@@ -311,5 +314,11 @@ class TestVifibSlaposRestAPIV1(ERP5TypeTestCase):
self.json_response)
self.assertSimulatorEmpty()
def test_OPTIONS(self):
raise NotImplementedError
def test_instance_OPTIONS_not_logged_in(self):
self.connection.request(method='OPTIONS',
url='/'.join([self.api_path, 'instance']))
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(204)
self.assertResponseNoContentType()
self.assertSimulatorEmpty()
10
\ No newline at end of file
11
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment