-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(set-up-postgres): Set up postgres database
- stop tracking django migrations by adding all migration folders to git - update requrements.txt with django-environ and psycopg2 - add .env file with local db configuration - add database settings in settings.py - add unit tests for database connection and vendor verification - update .travis.yml - update the README.md documentation file [Starts #161967003]
- Loading branch information
1 parent
e9003b3
commit 9ff6fff
Showing
8 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,3 +91,5 @@ ENV/ | |
|
||
# SQLite3 | ||
db.sqlite3 | ||
|
||
authors/apps/*/migrations/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import pytest | ||
from django.db import connection | ||
|
||
|
||
@pytest.mark.django_db | ||
class TestDatabaseConnection: | ||
"""Test cases -for db connection""" | ||
db_connection = connection | ||
|
||
def test_db_is_connected(self): | ||
""" | ||
asserts that a database cursor can be opened | ||
:return: | ||
""" | ||
cursor = self.db_connection.cursor() | ||
assert cursor.closed is False | ||
|
||
def test_db_vendor_is_postgres(self): | ||
"""Verify the databases vendors name""" | ||
assert self.db_connection.vendor == "postgresql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters