def test_user_view(self): from shootout.views import user_view self.config.testing_securitypolicy('username') _registerRoutes(self.config) _registerCommonTemplates(self.config) request = testing.DummyRequest() request.matchdict = {'username': '******'} user = self._addUser() result = user_view(request) self.assertEqual(result['user'].username, 'username') self.assertEqual(result['user'].user_id, 1)
def test_user_view(self): from shootout.views import user_view self.config.testing_securitypolicy(u'username') self.config.include('shootout.addroutes') self.config.include(register_templates) request = testing.DummyRequest() request.matchdict = {'username': u'username'} self._addUser() result = user_view(request) self.assertEqual(result['user'].username, u'username') self.assertEqual(result['user'].user_id, 1)
def test_user_view(self): from shootout.views import user_view self.config.testing_securitypolicy(u"username") self.config.include("shootout.addroutes") self.config.include(register_templates) request = testing.DummyRequest() request.matchdict = {"username": u"username"} self._addUser() result = user_view(request) self.assertEqual(result["user"].username, u"username") self.assertEqual(result["user"].user_id, 1)