class NewWebUITest(AgiloTestCase): def setUp(self): self.super() self.view = NewBacklogView(self.env) self.teh.grant_permission(Usernames.team_member, Action.BACKLOG_VIEW) def req(self, username=Usernames.team_member, **kwargs): return self.teh.mock_request(username=username, args=kwargs) def request_backlog(self, a_backlog): returned_values = ValueObject( self.view.do_get( self.req(name=a_backlog.name, scope=a_backlog.scope))) returned_values.backlog_info = ValueObject( json.loads(returned_values.backlog_info)) return returned_values def test_raises_permission_error_if_you_are_not_allowed_to_view_the_backlog( self): self.assert_raises(PermissionError, self.view.do_get, self.req(username='******')) def test_can_return_backlog_info(self): sprint_start = date_to_datetime(today() - timedelta(days=4)) sprint_end = sprint_start + timedelta(days=1) sprint = self.teh.create_sprint(name='fnord', start=sprint_start, end=sprint_end) backlog = self.teh.create_backlog(scope=sprint.name, b_type=BacklogType.SPRINT) info = self.request_backlog(backlog).backlog_info self.assert_not_none(info.content['configured_columns'])
class NewBacklogStoresScopeInSessionTest(AgiloTestCase): def setUp(self): self.super() self.view = NewBacklogView(self.env) self.teh.grant_permission(Usernames.anonymous, Action.BACKLOG_VIEW) def req(self, a_backlog): args = dict(name=a_backlog.name, scope=a_backlog.scope) return self.teh.mock_request(args=args) def test_module_stores_sprint_in_session(self): sprint = self.teh.create_sprint(name='fnord') backlog = self.teh.create_backlog(scope=sprint.name, b_type=BacklogType.SPRINT) req = self.req(backlog) self.assert_none(SessionScope(req).sprint_name()) self.view.do_get(req) self.assert_equals(sprint.name, SessionScope(req).sprint_name())
class NewWebUITest(AgiloTestCase): def setUp(self): self.super() self.view = NewBacklogView(self.env) self.teh.grant_permission(Usernames.team_member, Action.BACKLOG_VIEW) def req(self, username=Usernames.team_member, **kwargs): return self.teh.mock_request(username=username, args=kwargs) def request_backlog(self, a_backlog): returned_values = ValueObject(self.view.do_get(self.req(name=a_backlog.name, scope=a_backlog.scope))) returned_values.backlog_info = ValueObject(json.loads(returned_values.backlog_info)) return returned_values def test_raises_permission_error_if_you_are_not_allowed_to_view_the_backlog(self): self.assert_raises(PermissionError, self.view.do_get, self.req(username='******')) def test_can_return_backlog_info(self): sprint_start = date_to_datetime(today() - timedelta(days=4)) sprint_end = sprint_start + timedelta(days=1) sprint = self.teh.create_sprint(name='fnord', start=sprint_start, end=sprint_end) backlog = self.teh.create_backlog(scope=sprint.name, b_type=BacklogType.SPRINT) info = self.request_backlog(backlog).backlog_info self.assert_not_none(info.content['configured_columns'])
def setUp(self): self.super() self.view = NewBacklogView(self.env) self.teh.grant_permission(Usernames.anonymous, Action.BACKLOG_VIEW)