Skip to content

Commit

Permalink
Test SubConstituencyListView
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMwashuma committed Nov 4, 2024
1 parent b6789ae commit 16e8db8
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tally_ho/apps/tally/tests/views/data/test_sub_cons_list_view.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from django.test import RequestFactory

from tally_ho.apps.tally.views.data import sub_constituency_list_view as views
from tally_ho.libs.permissions import groups
from tally_ho.libs.tests.test_base import create_tally, TestBase


class TestSubConstituencyListView(TestBase):
def setUp(self):
self.factory = RequestFactory()
self._create_permission_groups()
self._create_and_login_user()
self._add_user_to_group(self.user, groups.SUPER_ADMINISTRATOR)

def test_ballot_list_view(self):
tally = create_tally()
tally.users.add(self.user)
view = views.SubConstituencyListView.as_view()
request = self.factory.get('/')
request.user = self.user
request.session = {}
response = view(request, tally_id=tally.pk)
self.assertContains(response, "Sub Constituencies List")

0 comments on commit 16e8db8

Please sign in to comment.