def setUp(self): self.env = EnvironmentStub() self.mmodule = MilestoneModule(self.env) self.terms = ['MilestoneAlpha', 'MilestoneBeta', 'MilestoneGamma'] for term in self.terms + [' '.join(self.terms)]: m = Milestone(self.env) m.name = term m.due = datetime_now(utc) m.description = random_sentence() m.insert()
def milestone_setup(tc): from datetime import datetime from trac.util.datefmt import utc boo = Milestone(tc.env) boo.name = 'boo' boo.completed = boo.due = None boo.insert() roo = Milestone(tc.env) roo.name = 'roo' roo.completed = datetime.now(utc) roo.due = None roo.insert()
def setUp(self): self.env = EnvironmentStub(default_data=True) self.mmodule = MilestoneModule(self.env) self.terms = ['MilestoneAlpha', 'MilestoneBeta', 'MilestoneGamma'] for term in self.terms + [' '.join(self.terms)]: m = Milestone(self.env) m.name = term m.due = datetime_now(utc) m.description = u"""\ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod \ tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim \ veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea \ commodo consequat. Duis aute irure dolor in reprehenderit in voluptate \ velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat \ cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id \ est laborum.""" m.insert()
def insert_milestone(self, name, due=None): milestone = Milestone(self.env) milestone.name = name milestone.due = due milestone.insert() return milestone