Python django.views() Examples

The following are 1 code examples of django.views(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module django , or try the search function .
Example #1
Source File: test_urls.py    From django-cruds with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_crud_for_model(self):
        urls = crud_for_model(Author)
        self.assertEqual(len(urls), 5)
        self.assertEqual(urls[0].name, 'testapp_author_list')
        self.assertIs(urls[0].callback.view_class, views.CRUDListView)
        self.assertEqual(urls[1].name, 'testapp_author_create')
        self.assertIs(urls[1].callback.view_class, views.CRUDCreateView)
        self.assertEqual(urls[2].name, 'testapp_author_detail')
        self.assertIs(urls[2].callback.view_class, views.CRUDDetailView)
        self.assertEqual(urls[3].name, 'testapp_author_update')
        self.assertIs(urls[3].callback.view_class, views.CRUDUpdateView)
        self.assertEqual(urls[4].name, 'testapp_author_delete')
        self.assertIs(urls[4].callback.view_class, views.CRUDDeleteView)