You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mvapi/election/tests.py

14 lines
436 B

from django.test import TestCase
from rest_framework.test import APITestCase
from election.models import Election
from django.urls import reverse
# Create your tests here.
class ElectionCreateAPIViewTestCase(APITestCase):
url = reverse("election:create")
def test_create_election(self):
response = self.client.post(self.url, {"title": "testing election/create !"})
self.assertEqual(201, response.status_code)