Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.test import Client
- from django.test import TestCase
- from .views import initdb, supplier_list
- from django.core.exceptions import ObjectDoesNotExist
- class AccoradnceTestCase(TestCase):
- def setUp(self):
- initdb(3)
- def test_supplier_id_access(self):
- c = Client()
- with self.assertRaises(ObjectDoesNotExist) as cm:
- response = c.get('/supply/' + str(999) + '/')
- the_exception = cm.exception
- self.assertEqual(isinstance(the_exception, ObjectDoesNotExist), True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement