def test_user_list_view(self): """ Test the response of the `user_list` view.""" self.dummy_user_fixture() from anuket.views.user import user_list_view request = AnuketDummyRequest() response = user_list_view(request) from webhelpers.paginate import Page self.assertIsInstance(response['users'], Page)
def test_user_list_view_with_sort(self): """ Test the response of the `user_list` view with a column sort.""" self.dummy_user_fixture() from anuket.views.user import user_list_view request = AnuketDummyRequest() request.method = 'POST' request.params['sort'] = 'username' response = user_list_view(request) from webhelpers.paginate import Page self.assertIsInstance(response['users'], Page)
def test_user_list_view_with_empty_search(self): """ Test the response of the `user_list` view with a search who have an empty result. """ self.dummy_user_fixture() from anuket.views.user import user_list_view request = AnuketDummyRequest() request.method = 'POST' request.params['search'] = u'donotfoundme' response = user_list_view(request) from webhelpers.paginate import Page self.assertIsInstance(response['users'], Page) self.assertEqual(request.session.pop_flash('error')[0], u"There is no results!")
def test_user_list_view_with_empty_search(self): """ Test the response of the `user_list` view with a search who have an empty result. """ self.dummy_user_fixture() from anuket.views.user import user_list_view request = AnuketDummyRequest() request.method = 'POST' request.params['search'] = u'donotfoundme' response = user_list_view(request) from webhelpers.paginate import Page self.assertIsInstance(response['users'], Page) self.assertEqual( request.session.pop_flash('error')[0], u"There is no results!")