コード例 #1
0
ファイル: tests.py プロジェクト: emelieholm/voteit.dutt
 def test_render_result(self):
     self.config.include('pyramid_chameleon')
     request = testing.DummyRequest()
     _attach_request_methods(request)
     ai = self._fixture()
     poll = ai['poll']
     self._add_votes(poll)
     poll.close_poll()
     plugin = poll.get_poll_plugin()
     view = BaseView(poll, request)
     self.failUnless('p1' in plugin.render_result(view))
コード例 #2
0
 def test_func_context_outside_meeting(self):
     root = _fixture(self.config)
     self._extra_fixtures(root)
     context = root['users']['admin']
     request = testing.DummyRequest()
     request.meeting = None
     request.root = root
     request.dt_handler = DateTimeHandler(request)
     view = BaseView(context, request)
     res = self._fut(context, request, None, view=view)
     #All things should be in view now
     self.assertIn("Prop p1", res)
     self.assertIn("Disc d2", res)
コード例 #3
0
ファイル: tests.py プロジェクト: VoteIT/voteit.schulze
 def test_render_result(self):
     poll = _setup_poll_fixture(self.config)
     poll.set_field_value('poll_plugin', 'schulze_pr')
     _add_votes(poll)
     poll.close_poll()
     plugin = poll.get_poll_plugin()
     request = testing.DummyRequest()
     request.root = find_root(poll)
     request.meeting = request.root['m']
     apply_request_extensions(request)
     view = BaseView(poll, request)
     result = plugin.render_result(view)
     self.assertTrue('first proposal' in result)
     self.assertTrue('third proposal' in result)
コード例 #4
0
ファイル: tests.py プロジェクト: VoteIT/voteit.schulze
 def test_render_result(self):
     poll = self._fixture()
     _add_votes(poll)
     poll.poll_settings['winners'] = 2
     poll.close_poll()
     plugin = poll.get_poll_plugin()
     request = testing.DummyRequest()
     request.root = find_root(poll)
     request.meeting = request.root['m']
     apply_request_extensions(request)
     view = BaseView(poll, request)
     result = plugin.render_result(view)
     self.assertTrue('first proposal' in result)
     self.assertTrue('second proposal' in result)
コード例 #5
0
 def test_integration(self):
     from voteit.core.models.user import User
     self.config.scan('voteit.core.views.components.user_info')
     root = _fixture(self.config)
     root['u'] = context = User()
     request = testing.DummyRequest(context=context)
     request.meeting = None
     request.root = root
     view = BaseView(context, request)
     self.assertIsInstance(
         render_view_action(context,
                            request,
                            'user_info',
                            'latest_meeting_entries',
                            view=view), unicode)