diff --git a/.gitignore b/.gitignore index 55c10a8..8046ca9 100644 --- a/.gitignore +++ b/.gitignore @@ -88,3 +88,4 @@ ENV/ # Rope project settings .ropeproject /db.sqlite3 +/src/db.sqlite3 diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..b564ac8 --- /dev/null +++ b/circle.yml @@ -0,0 +1,9 @@ +machine: + python: + version: 3.5.2 +dependencies: + post: + - pip install -r ./deps/testing.txt +test: + override: + - ./src/manage.py test ./src \ No newline at end of file diff --git a/deps/base.txt b/deps/base.txt index 08bc269..dea4df8 100644 --- a/deps/base.txt +++ b/deps/base.txt @@ -1,4 +1,4 @@ -django -graphene-django -django-filter -django-environ +Django==1.10.3 +graphene-django==1.2.0 +django-filter==1.0.1 +django-environ==0.4.1 \ No newline at end of file diff --git a/deps/prod.txt b/deps/prod.txt index 2804d2f..e4d50d4 100644 --- a/deps/prod.txt +++ b/deps/prod.txt @@ -1,4 +1,4 @@ -r base.txt -psycopg2 -waitress -whitenoise \ No newline at end of file +psycopg2==2.6.2 +waitress==1.0.1 +whitenoise==3.2.2 \ No newline at end of file diff --git a/deps/testing.txt b/deps/testing.txt index 0283891..253d8b3 100644 --- a/deps/testing.txt +++ b/deps/testing.txt @@ -1 +1,2 @@ -prospector \ No newline at end of file +prospector==0.12.4 +coverage==4.2 \ No newline at end of file diff --git a/src/todos/tests.py b/src/todos/tests.py index 7ce503c..be04377 100644 --- a/src/todos/tests.py +++ b/src/todos/tests.py @@ -1,3 +1,20 @@ -from django.test import TestCase +from django.contrib.auth.models import User +from django.test import TestCase, RequestFactory +from .models import TodoModel + # Create your tests here. +class TodoTest(TestCase): + def setUp(self): + self.user = User.objects.create_user( + username='test_user', + first_name='test', + last_name='user', + email='test@user.com', + password='top_secret' + ) + + TodoModel.objects.create(user=self.user, text="roar") + + def test_animals_can_speak(self): + todo = TodoModel.objects.get(text="roar")