Skip to content

Commit

Permalink
tests: lay the groundwork for testing in Django
Browse files Browse the repository at this point in the history
  • Loading branch information
nicomiguelino committed Aug 23, 2024
1 parent f4eb6fb commit 35163b2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
8 changes: 5 additions & 3 deletions anthias_django/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@

# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/data/.screenly/screenly.db',
}
'NAME': (
'/data/.screenly/test.db' if getenv('ENVIRONMENT') == 'test'
else '/data/.screenly/screenly.db'
),
},
}


Expand Down
19 changes: 17 additions & 2 deletions api/tests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
from django.test import TestCase # noqa F401
from django.test import TestCase
from django.urls import reverse
from rest_framework.test import APIClient

# Create your tests here.

class EndpointsTestV1_1(TestCase):
def setUp(self):
pass

def tearDown(self):
pass

# @TODO: Fix database migrations to make this test pass.
def test_get_asset_should_return_empty(self):
client = APIClient()
response = client.get(reverse('api:asset_list_v1_1'))

self.assertEqual(response.status_code, 200)

0 comments on commit 35163b2

Please sign in to comment.