def test_get_user_looks_for_user_in_request(self): user = N(User) request = RequestFactory().get('') request.user = user view = AddWatcher() view.request = request self.assertEqual(user, view.get_user())
def test_get_object_tries_to_get_decision(self, decisions): view = AddWatcher() view.args = [] view.kwargs = {'decision_id': 1} view.get_object() decisions.get.assert_called_with(pk=1)
EconsensusActionitemUpdateView, EconsensusActionitemListView, OrganizationRedirectView, YourDetails, UserNotificationSettings, EconsensusActionitemDetailView, DecisionSearchView) from models import Feedback from publicweb.views import AddWatcher, RemoveWatcher urlpatterns = patterns('econsensus.publicweb.views', url(r'^user_settings/your_details/$', YourDetails.as_view(), name='your_details'), url(r'^user_settings/notification_settings/(?P<org_slug>[-\w]+)/$', UserNotificationSettings.as_view(), name='notification_settings'), url(r'^add_watcher/(?P<decision_id>\d+)/$', AddWatcher.as_view(), name="add_watcher"), url(r'^remove_watcher/(?P<decision_id>\d+)/$', RemoveWatcher.as_view(), name="remove_watcher"), url(r'^(?P<org_slug>[-\w]+)/export_csv/$', ExportCSV.as_view(), name='publicweb_export_csv'), # Feedback urls... url(r'^feedback/create/(?P<parent_pk>[\d]+)/$', FeedbackCreate.as_view(template_name='feedback_update_page.html'), name='publicweb_feedback_create'), url(r'^feedback/update/(?P<pk>[\d]+)/$', FeedbackUpdate.as_view(template_name='feedback_update_page.html'), name='publicweb_feedback_update'),