From 3394862e978c1c4c52783eeb470c6a7c0764dfc0 Mon Sep 17 00:00:00 2001 From: Brobin Date: Tue, 13 Oct 2015 18:49:03 -0500 Subject: [PATCH] add edge case test for invalid format --- tests/api/tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/api/tests.py b/tests/api/tests.py index 97898a6..79d7955 100644 --- a/tests/api/tests.py +++ b/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): @@ -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)) +