Skip to content

Commit

Permalink
Merge pull request #6 from andela/ch-Integrate-TravisCI-164047052
Browse files Browse the repository at this point in the history
#164047052 Intergrates TravisCI to project repo on github
  • Loading branch information
Joan Ngatia committed Mar 1, 2019
2 parents b88865c + 83d5c9b commit fbcfd60
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
language: python

python:
- "3.6.7"

# install dependencies
install:
- pip install -r requirements.txt
- pip install coveralls


before_script:
- psql -c 'create database olympians;' -U postgres

# run tests

script:
- python manage.py makemigrations
- python manage.py migrate
- coverage run --source=authors.apps manage.py test
- coverage report

after_success:
- coverallslanguage: python
- coveralls
8 changes: 4 additions & 4 deletions authors/apps/authentication/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def test_retrieve_user_unauthenticated(self):
response = self.client.get('/api/user/')
result = json.loads(response.content)

self.assertIn('detail', str(result))
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertIn('Authentication credentials were not provided.', str(result))
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)

def test_update_user_unauthenticated(self):
"""
Expand All @@ -134,5 +134,5 @@ def test_update_user_unauthenticated(self):
response = self.client.put('/api/user/', self.user, format='json')
result = json.loads(response.content)

self.assertIn('detail', str(result))
self.assertEqual(response.status_code, status.HTTP_401_UNAUTHORIZED)
self.assertIn('Authentication credentials were not provided.', str(result))
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
2 changes: 1 addition & 1 deletion authors/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.environ['DB_NAME'],
'USER': os.environ['DB_USER'],
'PASSWORD': os.environ['DB_PASSWORD'],
'NAME': os.environ['DB_NAME'],
'HOST': os.environ['HOST'],
'PORT': '',
}
Expand Down

0 comments on commit fbcfd60

Please sign in to comment.