test_generics.py 537 B

12345678910111213141516
  1. from django.test import TestCase
  2. from django.test.client import RequestFactory
  3. from simple_app.views import SimpleBulkUpdateAPIView
  4. class TestBulkUpdateAPIView (TestCase):
  5. def test_OPTIONS_request(self):
  6. """
  7. OPTIONS requests must work for CORS requests. Test that OPTIONS
  8. requests aren't failing for simple cases.
  9. """
  10. view = SimpleBulkUpdateAPIView.as_view()
  11. request = RequestFactory().options('')
  12. response = view(request)
  13. self.assertEqual(response.status_code, 200)