Skip to content

Commit c38a269

Browse files
committed
Merge branch 'development' of https://github.com/cmu-delphi/signal_documentation into OKRS24-52-Redesign-Signal-Card
2 parents 66b6586 + 321620c commit c38a269

20 files changed

+234
-124
lines changed

.github/workflows/generate-sphynx-docs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Update Sphinx Documentation
22

33
on:
44
pull_request:
5+
branches:
6+
- develop
57
types: [opened, synchronize, reopened]
68

79
jobs:

Pipfile.lock

Lines changed: 107 additions & 106 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datasources/tests/test_views.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from django.test import TestCase
2+
from django.urls import reverse
3+
from faker import Faker
4+
5+
from datasources.models import DataSource
6+
from datasources.tests.factories import DataSourceFactory
7+
8+
fake = Faker()
9+
10+
11+
class DataSourceListViewTest(TestCase):
12+
13+
def setUp(self):
14+
for _ in range(fake.random_int(min=1, max=100)):
15+
DataSourceFactory()
16+
17+
def test_datasource_list_view(self):
18+
response = self.client.get(reverse('datasources'))
19+
self.assertEqual(response.status_code, 200)
20+
self.assertTemplateUsed(response, 'datasources/datasource_list.html')
21+
self.assertTrue('datasource_list' in response.context)
22+
self.assertEqual(response.context['datasource_list'].count(), DataSource.objects.count())

src/datasources/urls.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from django.urls import path
2+
from django.urls.resolvers import URLPattern
3+
4+
from datasources.views import DataSourceListView
5+
6+
urlpatterns: list[URLPattern] = [
7+
path('', DataSourceListView.as_view(), name='datasources'),
8+
]

src/datasources/views.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from django.views.generic import ListView
2+
3+
from datasources.models import DataSource
4+
5+
6+
class DataSourceListView(ListView):
7+
"""
8+
ListView for displaying a list of DataSource objects.
9+
"""
10+
11+
model = DataSource
12+
template_name = "datasources/datasource_list.html"
28 Bytes
Binary file not shown.
5.5 KB
Binary file not shown.
78 Bytes
Binary file not shown.
24.3 KB
Binary file not shown.
-62 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)