Commit a55a90018e1925b55dc0ed69b94e80ef99baeca9

Authored by Andrew Buss
Exists in master

Merge branch 'master' of git.ucsd.edu:110swag/flashy-backend

Showing 3 changed files Side-by-side Diff

flashcards/tests/test_api.py View file @ a55a900
... ... @@ -42,16 +42,13 @@
42 42 self.assertContains(response, 'Account is disabled', status_code=403)
43 43  
44 44 def test_logout(self):
45   - url = '/api/login'
46   - data = {'email': 'test@flashy.cards', 'password': '1234'}
47   - response = self.client.post(url, data, format='json')
48   - self.assertEqual(response.status_code, HTTP_200_OK)
  45 + url = '/api/logout'
  46 + self.client.login(email='test@flashy.cards', password='1234')
  47 + response = self.client.post(url)
  48 + self.assertEqual(response.status_code, HTTP_204_NO_CONTENT)
49 49  
50   - p = self.client.post('/api/logout')
51   - self.assertEqual(p.status_code, HTTP_204_NO_CONTENT)
  50 + # since we're not logged in, we should get a 401 response
52 51 response = self.client.get('/api/users/me', format='json')
53   -
54   - # since we're not logged in, we shouldn't be able to see this
55 52 self.assertEqual(response.status_code, HTTP_401_UNAUTHORIZED)
56 53  
57 54  
requirements.txt View file @ a55a900
... ... @@ -11,4 +11,5 @@
11 11 django-ses
12 12 coverage
13 13 django-rest-swagger
  14 +newrelic
scripts/run_production.sh View file @ a55a900
1 1 #!/bin/bash -xe
2 2 source secrets.sh
3 3 source venv/bin/activate
4   -/srv/flashy-backend/venv/bin/gunicorn --pid /run/flashy/gunicorn.pid -w 6 -n flashy -b 127.0.0.1:7002 flashy.wsgi
  4 +newrelic-admin run-program /srv/flashy-backend/venv/bin/gunicorn --pid /run/flashy/gunicorn.pid -w 6 -n flashy -b 127.0.0.1:7002 flashy.wsgi