Skip to content

Commit 6821623

Browse files
committed
Add initial test setup and hello world test
1 parent cc031d8 commit 6821623

File tree

7 files changed

+22
-1
lines changed

7 files changed

+22
-1
lines changed

lung_cancer_screening/core/__init__.py

Whitespace-only changes.

lung_cancer_screening/core/tests/__init__.py

Whitespace-only changes.

lung_cancer_screening/core/tests/acceptance/__init__.py

Whitespace-only changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from django.test import TestCase, Client
2+
3+
class TestHomepage(TestCase):
4+
5+
def setUp(self):
6+
self.client = Client()
7+
8+
def test_homepage_displays_hello_world(self):
9+
response = self.client.get('/')
10+
self.assertEqual(response.status_code, 200)
11+
self.assertContains(response, "hello world")

lung_cancer_screening/urls.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
"""
1717
from django.contrib import admin
1818
from django.urls import path
19+
from . import views
1920

2021
urlpatterns = [
22+
path('', views.home, name='home'),
2123
path('admin/', admin.site.urls),
2224
]

lung_cancer_screening/views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.http import HttpResponse
2+
3+
def home(request):
4+
"""Homepage view that displays hello world."""
5+
return HttpResponse("hello world")

makefiles/dev.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: dev-run dev-up dev-down dev-logs dev-shell dev-migrate dev-makemigrations dev-clean
1+
.PHONY: dev-run dev-up dev-down dev-logs dev-shell dev-migrate dev-makemigrations dev-clean dev-test
22

33
dev-run:
44
docker-compose up --build
@@ -24,3 +24,6 @@ dev-makemigrations:
2424
dev-clean:
2525
docker-compose down -v --remove-orphans
2626
docker system prune -f
27+
28+
dev-test:
29+
docker-compose run web python manage.py test

0 commit comments

Comments
 (0)