Skip to content

Commit

Permalink
add edge case test for invalid format
Browse files Browse the repository at this point in the history
  • Loading branch information
Brobin committed Oct 13, 2015
1 parent 7270ed5 commit 3394862
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/api/tests.py
@@ -1,6 +1,7 @@

from rest_framework.test import APITestCase
from django.core.management import call_command
from django.core.management.base import CommandError


class BaseTestCase(APITestCase):
Expand Down Expand Up @@ -106,3 +107,13 @@ class ModelViewSetTest(BaseTestCase):

def test_modelviewset(self):
self.run_tests('modelviewset')


class EdgeCaseTest(BaseTestCase):

def test_invalid_format(self):
try:
self.generate_api('asdf')
except Exception as e:
self.assertTrue(isinstance(e, CommandError))

0 comments on commit 3394862

Please sign in to comment.