From 1a3e459bfb9c8afa1b03e3210436e3c2582f8ff3 Mon Sep 17 00:00:00 2001 From: Andrew Buss Date: Tue, 5 May 2015 02:46:05 -0700 Subject: [PATCH] Switched to local.flashy.cards cause chrome sux --- flashcards/tests/test_api.py | 7 ++----- nginxconf/flashy.cards | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/flashcards/tests/test_api.py b/flashcards/tests/test_api.py index 98115e8..04d25a6 100644 --- a/flashcards/tests/test_api.py +++ b/flashcards/tests/test_api.py @@ -76,13 +76,10 @@ class RegistrationTest(APITestCase): self.assertIn(user.confirmation_key, mail.outbox[0].body) # log the user out - response = self.client.post('/api/logout', format='json') - self.assertEqual(response.status_code, 204) + self.client.logout() # log the user in with their registered credentials - data = {'email': 'none@none.com', 'password': '1234'} - response = self.client.post('/api/login', data, format='json') - self.assertEqual(response.status_code, HTTP_200_OK) + self.client.login(email='none@none.com', password='1234') # try activating with an invalid key response = self.client.patch(url, {'confirmation_key': 'NOT A KEY'}) diff --git a/nginxconf/flashy.cards b/nginxconf/flashy.cards index 5f61f7e..61cd07f 100644 --- a/nginxconf/flashy.cards +++ b/nginxconf/flashy.cards @@ -22,7 +22,7 @@ server { } location ~ /(api|admin|api-auth)/ { - add_header 'Access-Control-Allow-Origin' 'http://localhost/'; + add_header 'Access-Control-Allow-Origin' 'http://local.flashy.cards/'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PATCH, PUT'; proxy_pass http://backend_production; -- 1.9.1