Пример #1
0
 def test_flash_message(self):
     controller = SampleActionController()
     controller.request = Request('GET')
     controller.flash_messages.add('testing')
     controller.flash_messages.add('something')
     assert controller.flash_messages['info'] == ['testing', 'something']
     for namespace, message in controller.flash_messages:
         assert namespace == 'info'
     assert not controller.flash_messages.messages
Пример #2
0
 def test_method_template(self):
     controller = SampleActionController()
     assert controller.get_execute_method_path(
         action='something') == ['sampleactioncontroller', 'something']
Пример #3
0
 def test_execute_result(self):
     controller = SampleActionController()
     assert controller.execute(action='something') == 'something_action'
     assert controller.execute(action='blah') == 'blah_action'
Пример #4
0
 def test_repr(self):
     controller = SampleActionController()
     assert repr(
         controller) == '<tests.watson.mvc.support.SampleActionController>'