コード例 #1
0
ファイル: tests.py プロジェクト: leocarv/Roadmap
    def test_show_system(self, mk_conf, mk_render):
        mk_request = mock.Mock()
        mk_user = mock.Mock()
        mk_user.is_autenticated.return_value = True
        mk_request.user = mk_user

        mk_conf.JS_DEBUG = True
        views.show_system(mk_request)
        mk_render.assert_called_with('apirest/index.html',
                                            {'js_debug': True})
コード例 #2
0
ファイル: tests.py プロジェクト: leocarv/Roadmap
    def test_show_system_with_exception(self, mk_render):
        mk_request = mock.Mock()
        mk_user = mock.Mock()
        mk_user.is_autenticated.return_value = True
        mk_request.user = mk_user

        orig_lib = views.django.conf
        views.django.conf = {'blah': None}
        views.show_system(mk_request)
        mk_render.assert_called_with('apirest/index.html',
                                            {'js_debug': False})
        views.django.conf = orig_lib