Ejemplo n.º 1
0
 def test_get(self):
     template = "triggers/edited_thanks_trigger.html"
     # Setup request and view.
     request = RequestFactory().get('/th/trigger/edit/thanks')
     view = TriggerEditedTemplateView.as_view(template_name=template)
     # Run.
     response = view(request)
     # Check.
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.template_name[0],
                      'triggers/edited_thanks_trigger.html')
Ejemplo n.º 2
0
 def test_get(self):
     template = "triggers/edited_thanks_trigger.html"
     # Setup request and view.
     request = RequestFactory().get('/th/trigger/edit/thanks')
     view = TriggerEditedTemplateView.as_view(template_name=template)
     # Run.
     response = view(request)
     # Check.
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.template_name[0],
                      'triggers/edited_thanks_trigger.html')
Ejemplo n.º 3
0
 def test_get(self):
     template_name = "triggers/thanks_trigger.html"
     # Setup request and view.
     request = RequestFactory().get('/th/trigger/edit/thanks')
     view = TriggerEditedTemplateView.as_view(template_name=template_name)
     sentence = 'Your trigger has been successfully modified'
     # Run.
     response = view(request)
     # Check.
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.template_name[0],
                      'triggers/thanks_trigger.html')
     self.assertEqual(response.context_data['sentence'], sentence)
Ejemplo n.º 4
0
 def test_get(self):
     template = "triggers/thanks_trigger.html"
     # Setup request and view.
     request = RequestFactory().get('/th/trigger/edit/thanks')
     view = TriggerEditedTemplateView.as_view(template_name=template)
     sentence = 'Your trigger has been successfully modified'
     # Run.
     response = view(request)
     # Check.
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.template_name[0],
                      'triggers/thanks_trigger.html')
     self.assertEqual(response.context_data['sentence'], sentence)
Ejemplo n.º 5
0
 # * trigger
 # ****************************************
 url(r'^th/trigger/delete/(?P<pk>\d+)$',
     TriggerDeleteView.as_view(),
     name='delete_trigger'),
 url(r'^th/trigger/edit/(?P<pk>\d+)$',
     TriggerUpdateView.as_view(),
     name='edit_trigger'),
 url(r'^th/trigger/editprovider/(?P<trigger_id>\d+)$',
     trigger_edit, {'edit_what': 'Provider'},
     name='edit_provider'),
 url(r'^th/trigger/editconsumer/(?P<trigger_id>\d+)$',
     trigger_edit, {'edit_what': 'Consumer'},
     name='edit_consumer'),
 url(r'^th/trigger/edit/thanks',
     TriggerEditedTemplateView.as_view(),
     name="trigger_edit_thanks"),
 url(r'^th/trigger/delete/thanks',
     TriggerDeletedTemplateView.as_view(),
     name="trigger_delete_thanks"),
 url(r'^th/trigger/onoff/(?P<trigger_id>\d+)$',
     trigger_on_off,
     name="trigger_on_off"),
 url(r'^th/trigger/all/(?P<switch>(on|off))$',
     trigger_switch_all_to,
     name="trigger_switch_all_to"),
 # ****************************************
 # * service
 # ****************************************
 url(r'^th/service/$', UserServiceListView.as_view(),
     name='user_services'),
Ejemplo n.º 6
0
 # * trigger
 # ****************************************
 url(r'^th/trigger/delete/(?P<pk>\d+)$',
     TriggerDeleteView.as_view(),
     name='delete_trigger'),
 url(r'^th/trigger/edit/(?P<pk>\d+)$',
     TriggerUpdateView.as_view(),
     name='edit_trigger'),
 url(r'^th/trigger/editprovider/(?P<trigger_id>\d+)$',
     trigger_edit, {'edit_what': 'Provider'},
     name='edit_provider'),
 url(r'^th/trigger/editconsumer/(?P<trigger_id>\d+)$',
     trigger_edit, {'edit_what': 'Consumer'},
     name='edit_consumer'),
 url(r'^th/trigger/edit/thanks',
     TriggerEditedTemplateView.as_view(),
     name="trigger_edit_thanks"),
 url(r'^th/trigger/delete/thanks',
     TriggerDeletedTemplateView.as_view(),
     name="trigger_delete_thanks"),
 url(r'^th/trigger/onoff/(?P<trigger_id>\d+)$',
     trigger_on_off,
     name="trigger_on_off"),
 url(r'^th/trigger/all/(?P<switch>(on|off))$',
     trigger_switch_all_to,
     name="trigger_switch_all_to"),
 # ****************************************
 # * service
 # ****************************************
 url(r'^th/service/$', UserServiceListView.as_view(),
     name='user_services'),
Ejemplo n.º 7
0
 # trigger happy module
 # ****************************************
 path('th/', TriggerListView.as_view(), name='base'),
 url(r'^th/trigger/filter_by/(?P<trigger_filtered_by>[a-zA-Z]+)$', TriggerListView.as_view(),
     name='trigger_filter_by'),
 url(r'^th/trigger/order_by/(?P<trigger_ordered_by>[a-zA-Z_]+)$', TriggerListView.as_view(),
     name='trigger_order_by'),
 path('th/trigger/', TriggerListView.as_view(), name='home'),
 # ****************************************
 # * trigger
 # ****************************************
 url(r'^th/trigger/delete/(?P<pk>\d+)$', TriggerDeleteView.as_view(), name='delete_trigger'),
 url(r'^th/trigger/edit/(?P<pk>\d+)$', TriggerUpdateView.as_view(), name='edit_trigger'),
 path('th/trigger/editprovider/<int:trigger_id>', trigger_edit, {'edit_what': 'Provider'}, name='edit_provider'),
 path('th/trigger/editconsumer/<int:trigger_id>', trigger_edit, {'edit_what': 'Consumer'}, name='edit_consumer'),
 path('th/trigger/edit/thanks', TriggerEditedTemplateView.as_view(), name="trigger_edit_thanks"),
 path('th/trigger/delete/thanks', TriggerDeletedTemplateView.as_view(), name="trigger_delete_thanks"),
 path('th/trigger/onoff/<int:trigger_id>', trigger_on_off, name="trigger_on_off"),
 url(r'^th/trigger/all/(?P<switch>(on|off))$', trigger_switch_all_to, name="trigger_switch_all_to"),
 # ****************************************
 # * service
 # ****************************************
 path('th/services/', UserServiceListView.as_view(), name='user_services'),
 url(r'^th/service/add/(?P<service_name>\w+)$', UserServiceCreateView.as_view(), name='add_service'),
 url(r'^th/service/edit/(?P<pk>\d+)$', UserServiceUpdateView.as_view(), name='edit_service'),
 url(r'^th/service/delete/(?P<pk>\d+)$', UserServiceDeleteView.as_view(), name='delete_service'),
 url(r'^th/service/renew/(?P<pk>\d+)$', renew_service, name="renew_service"),
 path('th/service/delete/', UserServiceDeleteView.as_view(), name='delete_service'),
 url(r'^th/service/onoff/(?P<user_service_id>\d+)/(?P<switch>(on|off))$', service_related_triggers_switch_to,
     name="service_related_triggers_switch_to"),
 # ****************************************
Ejemplo n.º 8
0
 url(
     r"^th/trigger/order_by/(?P<trigger_ordered_by>[a-zA-Z_]+)$", TriggerListView.as_view(), name="trigger_order_by"
 ),
 url(r"^th/trigger/$", TriggerListView.as_view(), name="home"),
 # ****************************************
 # * trigger
 # ****************************************
 url(r"^th/trigger/delete/(?P<pk>\d+)$", TriggerDeleteView.as_view(), name="delete_trigger"),
 url(r"^th/trigger/edit/(?P<pk>\d+)$", TriggerUpdateView.as_view(), name="edit_trigger"),
 url(
     r"^th/trigger/editprovider/(?P<trigger_id>\d+)$", trigger_edit, {"edit_what": "Provider"}, name="edit_provider"
 ),
 url(
     r"^th/trigger/editconsumer/(?P<trigger_id>\d+)$", trigger_edit, {"edit_what": "Consumer"}, name="edit_consumer"
 ),
 url(r"^th/trigger/edit/thanks", TriggerEditedTemplateView.as_view(), name="trigger_edit_thanks"),
 url(r"^th/trigger/delete/thanks", TriggerDeletedTemplateView.as_view(), name="trigger_delete_thanks"),
 url(r"^th/trigger/onoff/(?P<trigger_id>\d+)$", trigger_on_off, name="trigger_on_off"),
 url(r"^th/trigger/fire/(?P<trigger_id>\d+)$", fire_trigger, name="fire_trigger"),
 url(r"^th/trigger/all/(?P<switch>(on|off))$", trigger_switch_all_to, name="trigger_switch_all_to"),
 # ****************************************
 # * service
 # ****************************************
 url(r"^th/service/$", UserServiceListView.as_view(), name="user_services"),
 url(r"^th/service/(?P<action>\w+)$", UserServiceListView.as_view(), name="user_services"),
 url(r"^th/service/add/$", UserServiceCreateView.as_view(), name="add_service"),
 url(r"^th/service/edit/(?P<pk>\d+)$", UserServiceUpdateView.as_view(), name="edit_service"),
 url(r"^th/service/delete/(?P<pk>\d+)$", UserServiceDeleteView.as_view(), name="delete_service"),
 url(r"^th/service/renew/(?P<pk>\d+)$", renew_service, name="renew_service"),
 url(r"^th/service/delete/$", UserServiceDeleteView.as_view(), name="delete_service"),
 url(