def test_cannotSetRequestorForStory(self): story = Story() requestor = "me" story.SetRequestedBy(requestor) item = PivotalTrackerItem(story) item.withRequestor(PivotalUser(requestor)) self.assertEqual([], item.decoratedStory().UPDATE_FIELDS)
def test_canSetRequestor(self): item = PivotalTrackerItem() requestor = "me" item.withRequestor(PivotalUser(requestor)) self.assertEqual(requestor, item.requestor().pivotal()) self.assertEqual(requestor, item.underlying().GetRequestedBy()) self.assertTrue('requested_by' in item.decoratedStory().UPDATE_FIELDS)
def test_canChangeRequestor(self): tracker = self.pivotal_ item = PivotalTrackerItem().withSummary("test_canChangeRequestor-1").withDescription("can change the requestor of this ticket?") tracker.update(item) item = next(tracker.items()) newRequestor = PivotalUser(Env().get("pivotal", "otherUser")) item.withRequestor(newRequestor) tracker.update(item) item = next(tracker.items()) self.assertTrue(Env().get("pivotal", "otherUser") in item.requestor().pivotal())
def test_canChangeRequestor(self): tracker = self.pivotal_ item = PivotalTrackerItem().withSummary( "test_canChangeRequestor-1").withDescription( "can change the requestor of this ticket?") tracker.update(item) item = next(tracker.items()) newRequestor = PivotalUser(Env().get("pivotal", "otherUser")) item.withRequestor(newRequestor) tracker.update(item) item = next(tracker.items()) self.assertTrue( Env().get("pivotal", "otherUser") in item.requestor().pivotal())