add cors
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
2021-06-21 22:21:25 +02:00
parent a349eff9b0
commit a9f9c36eda
5 changed files with 38 additions and 7 deletions

View File

@ -17,6 +17,12 @@ class TestSkillsEndpoint(unittest.TestCase):
seed()
def test_skills_options(self):
response = self.client.options("/skills")
self.assertEqual(response.status_code, 200)
self.assertIn("Access-Control-Allow-Origin", response.headers)
self.assertEqual(response.headers["Access-Control-Allow-Origin"], "*")
def test_get_skills1(self):
response = self.client.get("/skills?search=p")
self.assertEqual(response.status_code, 200)
@ -30,6 +36,8 @@ class TestSkillsEndpoint(unittest.TestCase):
"name": "Python"
}]
}, response.json)
self.assertIn("Access-Control-Allow-Origin", response.headers)
self.assertEqual(response.headers["Access-Control-Allow-Origin"], "*")
if __name__ == "main":