示例#1
0
 def invoke_test_view(self, method=None, arguments=None, http_accept='text/html', expected_status_code=200):
     """
     Invokes the test view with the specified arguments (if provided).
     """
     request = self.create_mock_request(method=method, arguments=arguments, http_accept=http_accept)
     response = ExampleFragmentView.as_view()(request)
     assert response.status_code == expected_status_code
     return response
示例#2
0
文件: urls.py 项目: edx/web-fragments
#!/usr/bin/env python
"""
Provides a URL for testing
"""
from django.conf.urls import url

from web_fragments.examples.views import EXAMPLE_FRAGMENT_VIEW_NAME, ExampleFragmentView

urlpatterns = [
    url(r'^test_fragment$',
        ExampleFragmentView.as_view(),
        name=EXAMPLE_FRAGMENT_VIEW_NAME),
]