def setUp(self): super(IterationStatusSummary, self).setUp() self.user1 = User(username='******') self.user1.set_password('user1') self.user1.save() self.user2 = User(username='******') self.user2.set_password('user2') self.user2.save() self.p1 = Project() self.p1.save() self.p1.project_members.add(self.user1) self.p1.project_members.add(self.user2) self.p1.save()
class UserStory182(test.TestCase, TTW): fixtures = ['burndown.json'] username=password='******' def setUp(self): super(UserStory182, self).setUp() self.user = User(username=self.username) self.user.set_password(self.password) self.user.save() self.login() def testRestrictedThrows404(self): it = Iteration.objects.all()[0] response = self.client.get(it.get_absolute_url()) self.assertEqual(response.status_code, 404)
def setUp(self): self.user = User(username = '******') self.passwd = 'hi' self.user.set_password(self.passwd) self.user.save() self.project = Project(name = 'A Project') self.project.save() self.project.project_members.add(self.user) self.project.save() self.iteration = Iteration(start_date = '1990-01-01', end_date = '2020-01-01', project = self.project) self.iteration.save() self.story = UserStory(name = 'ABC', project = self.project, description = 'a userstory about abc', iteration = self.iteration, planned = 42, rank = 1, state = 10, blocked = True) self.story.save() task_states = dict((v, k) for (k, v) in Task.STATES) self.task_a = Task(name = "Task A", estimate = 8, remaining = 8, state = task_states['In Progress'], owner = self.user, user_story = self.story) self.task_a.save() self.task_b = Task(name = "Task B", estimate = 2, remaining = 2, state = task_states['Defined'], owner = self.user, user_story = self.story) self.task_b.save() super(TestUS49Base, self).setUp()
def setUp(self): self.ABC = Project(name='ABC') self.ABC.save() self.DEF = Project(name='DEF') self.DEF.save() self.EFG = Project(name='EFG') self.EFG.save() self.A = User(username='******') self.A.set_password('abc') self.A.save() self.B = User(username='******') self.B.set_password('def') self.B.save() self.C = User(username='******') self.C.set_password('ghi') self.C.save() self.ABC.project_members.add(self.A) self.ABC.project_members.add(self.B) self.DEF.project_members.add(self.B) super(TestUS34, self).setUp()
class TestUS21(SeleniumBase): def setUp(self): self.passwd = 'hola' # random_name() self.user = User(username=random_name()) self.user.set_password(self.passwd) self.user.save() self.proj1 = Project(name=random_name()) self.proj2 = Project(name=random_name()) for proj in self.proj1, self.proj2: proj.save() proj.project_members.add(self.user) proj.save() self.us1 = UserStory(name=random_name(), project=self.proj1) self.us1.save() self.us2 = UserStory(name=random_name(), project=self.proj2) self.us2.save() super(TestUS21, self).setUp() def tearDown(self): for obj in self.user, self.proj1, self.proj2, self.us1, self.us2: obj.delete() super(TestUS21, self).tearDown() def test_user_assigned_to_multiple_projects_switch_to_other_project(self): us_locator = "css=#user-story-list td.name a" b = self.browser b.click("link=Backlog") b.wait() this_us = b.get_text(us_locator) if this_us == self.us1.name: target_project, target_story = self.proj2, self.us2 else: assert this_us == self.us2.name target_project, target_story = self.proj1, self.us1 b.select("//li[@id='project-selection']/select", "label=" + target_project.name) b.wait() self.assertEqual(b.get_text(us_locator), target_story.name)
def setUp(self): self.passwd = 'hola' # random_name() self.user = User(username=random_name()) self.user.set_password(self.passwd) self.user.save() self.proj1 = Project(name=random_name()) self.proj2 = Project(name=random_name()) for proj in self.proj1, self.proj2: proj.save() proj.project_members.add(self.user) proj.save() self.us1 = UserStory(name=random_name(), project=self.proj1) self.us1.save() self.us2 = UserStory(name=random_name(), project=self.proj2) self.us2.save() super(TestUS21, self).setUp()
def setUp(self): self.user = User(username='******') self.passwd = 'hi' self.user.set_password(self.passwd) self.user.save() self.project = Project(name='A Project BB') self.project.save() self.project.project_members.add(self.user) self.project.save() self.story1 = UserStory(name='User Story A', rank=3, planned=3, project=self.project) self.story1.save() self.story2 = UserStory(name='User Story B', rank=2, planned=8, project=self.project) self.story2.save() self.story3 = UserStory(name='User Story C', rank=1, planned=5, project=self.project) self.story3.save() super(TestBacklogAddUSDetailed, self).setUp()
class TestBacklogAddUSDetailed(SeleniumBase): def setUp(self): self.user = User(username='******') self.passwd = 'hi' self.user.set_password(self.passwd) self.user.save() self.project = Project(name='A Project BB') self.project.save() self.project.project_members.add(self.user) self.project.save() self.story1 = UserStory(name='User Story A', rank=3, planned=3, project=self.project) self.story1.save() self.story2 = UserStory(name='User Story B', rank=2, planned=8, project=self.project) self.story2.save() self.story3 = UserStory(name='User Story C', rank=1, planned=5, project=self.project) self.story3.save() super(TestBacklogAddUSDetailed, self).setUp() def tearDown(self): self.project.delete() self.user.delete() for x in self.story1, self.story2, self.story3: x.delete() super(TestBacklogAddUSDetailed, self).tearDown() def test_create_complete_us(self): self.login(username='******', password='******') b = self.browser b.click("link=Backlog") b.wait() b.click("create-detailed-user-story") b.type("id_name", "A sample detailed user story") b.type("id_description", "This is a detailed user story") b.type("id_planned", "10") b.type("id_rank", "50") b.type("id_state", "10") b.click("id_blocked") b.click("us-create") self.assertEqual(b.get_text("us-span-4"), "A sample detailed user story")
class TestBacklogQuickAdd(SeleniumBase): def setUp(self): self.user = User(username='******') self.passwd = 'hi' self.user.set_password(self.passwd) self.user.save() self.project = Project(name='A Project') self.project.save() self.project.project_members.add(self.user) self.project.save() self.story1 = UserStory(name='User Story A', rank=3, planned=3, project=self.project) self.story1.save() self.story2 = UserStory(name='User Story B', rank=2, planned=8, project=self.project) self.story2.save() self.story3 = UserStory(name='User Story C', rank=1, planned=5, project=self.project) self.story3.save() super(TestBacklogQuickAdd, self).setUp() def tearDown(self): self.project.delete() self.user.delete() for x in self.story1, self.story2, self.story3: x.delete() super(TestBacklogQuickAdd, self).tearDown() def test_tc4(self): self.login(username='******', password='******') #sel.open("/accounts/login/") #sel.type("id_username", "User B") #sel.type("id_password", "hi") #sel.click("//input[@value='login']") b = self.browser b.click("link=Backlog") b.wait() b.click("create-user-story") b.type("id_name", "A sample user story") b.click("us-create") self.assertEqual(b.get_text("us-span-4"), "A sample user story")
class IterationStatusSummary(test.TestCase): def setUp(self): super(IterationStatusSummary, self).setUp() self.user1 = User(username='******') self.user1.set_password('user1') self.user1.save() self.user2 = User(username='******') self.user2.set_password('user2') self.user2.save() self.p1 = Project() self.p1.save() self.p1.project_members.add(self.user1) self.p1.project_members.add(self.user2) self.p1.save() def test_empty_case(self): it = Iteration(start_date=datetime.datetime.now(), end_date=datetime.datetime.now(), project=self.p1) it.save() self.assertEqual(it.estimated_without_owner, 0) self.assertEqual(it.user_estimated(self.user1.id), 0) self.assertEqual(it.user_progress(self.user1.id), 0) self.assertEqual(it.user_estimated(self.user2.id), 0) self.assertEqual(it.user_progress(self.user2.id), 0) self.assertEqual(it.users_total_status, [{'name':self.user1.username,'progress':0, 'estimated':0}, {'name':self.user2.username,'progress':0, 'estimated':0}, {'name':'no owner','progress':'', 'estimated':0}, ] ) def test_partial_case(self): it = Iteration(start_date=datetime.datetime.now(), end_date=datetime.datetime.now(), project=self.p1) it.save() us1 = UserStory(name='User story A', state=20, project=self.p1, iteration = it) us1.save() t1 = Task(name='Task 1 for US A', user_story = us1, owner= self.user1) t2 = Task(estimate=5, name='Task 2 for US A', user_story = us1, owner= self.user2) t3 = Task(estimate=10, name='Task 1 for US A', user_story = us1) for t in t1, t2, t3: t.save() tl1 = TaskLog(task=t1, summary="tasklog 1 for Task 1A", time_on_task=1, date=datetime.datetime.now(), owner=self.user1, iteration=it) tl2 = TaskLog(task=t2, summary="tasklog 2 for Task 2A", time_on_task=2, date=datetime.datetime.now(), owner=self.user1, iteration=it) for tl in tl1, tl2: tl.save() self.assertEqual(it.estimated_without_owner, 10) self.assertEqual(it.user_estimated(self.user1.id), 0) self.assertEqual(it.user_progress(self.user1.id), 3) self.assertEqual(it.user_estimated(self.user2.id), 5) self.assertEqual(it.user_progress(self.user2.id), 0) self.assertEqual(it.users_total_status, [{'name':self.user1.username,'progress':3, 'estimated':0}, {'name':self.user2.username,'progress':0, 'estimated':5}, {'name':'no owner','progress':'', 'estimated':10}, ] ) def test_complete_case(self): it = Iteration(start_date=datetime.datetime.now(), end_date=datetime.datetime.now(), project=self.p1) it.save() us1 = UserStory(name='User story A', planned=45, state=20, project=self.p1, iteration = it) us2 = UserStory(name='User story B', planned=30, state=30, project=self.p1, iteration = it) us1.save() us2.save() t1 = Task(estimate=10, name='Task 1 for US A', user_story = us1, owner= self.user1) t2 = Task(estimate=5, name='Task 2 for US A', user_story = us1, owner= self.user2) t3 = Task(estimate=1, name='Task 1 for US B', user_story = us2, owner= self.user1) t4 = Task(estimate=2, name='Task 2 for US B', user_story = us2, owner= self.user2) t5 = Task(estimate=5, name='Task 2 for US B', user_story = us2) t6 = Task(estimate=4, name='Task 2 for US B', user_story = us2) for t in t1, t2, t3, t4, t5, t6: t.save() tl1 = TaskLog(task=t1, summary="tasklog 1 for Task 1A", time_on_task=1, date=datetime.datetime.now(), owner=self.user1, iteration=it) tl2 = TaskLog(task=t2, summary="tasklog 2 for Task 2A", time_on_task=2, date=datetime.datetime.now(), owner=self.user1, iteration=it) tl3 = TaskLog(task=t3, summary="tasklog 1 for Task 1B", time_on_task=3, date=datetime.datetime.now(), owner=self.user2, iteration=it) tl4 = TaskLog(task=t4, summary="tasklog 2 for Task 2B", time_on_task=5, date=datetime.datetime.now(), owner=self.user2, iteration=it) for tl in tl1, tl2, tl3, tl4: tl.save() self.assertEqual(it.estimated_without_owner, 9) self.assertEqual(it.user_estimated(self.user1.id), 11) self.assertEqual(it.user_estimated(self.user2.id), 7) self.assertEqual(it.user_progress(self.user1.id), 3) self.assertEqual(it.user_progress(self.user2.id), 8) self.assertEqual(it.users_total_status, [{'name':self.user1.username,'progress':3, 'estimated':11}, {'name':self.user2.username,'progress':8, 'estimated':7}, {'name':'no owner','progress':'', 'estimated':9}, ] )
class TestUS34(SeleniumBase): do_login = do_logout = False def setUp(self): self.ABC = Project(name='ABC') self.ABC.save() self.DEF = Project(name='DEF') self.DEF.save() self.EFG = Project(name='EFG') self.EFG.save() self.A = User(username='******') self.A.set_password('abc') self.A.save() self.B = User(username='******') self.B.set_password('def') self.B.save() self.C = User(username='******') self.C.set_password('ghi') self.C.save() self.ABC.project_members.add(self.A) self.ABC.project_members.add(self.B) self.DEF.project_members.add(self.B) super(TestUS34, self).setUp() def tearDown(self): for obj in (self.ABC, self.DEF, self.EFG, self.A, self.B, self.C): obj.delete() super(TestUS34, self).tearDown() def test_tc16(self): self.login(username='******', password='******') self.assertEqual(self.browser.get_text('error-message'), u'Username / password combination does not exist') def test_tc17(self): self.login(username='******', password='******') self.assertEqual(self.browser.get_text('error-message'), u'Username / password combination does not exist') def test_tc18(self): self.login(username='******', password='******') opts = self.browser.get_select_options('css=#project-selection select') self.assertEqual(opts, [u'ABC']) def test_tc19(self): self.login(username='******', password='******') opts = self.browser.get_select_options('css=#project-selection select') self.assertEqual(opts, [u'ABC', u'DEF'])
def setUp(self): super(UserStory182, self).setUp() self.user = User(username=self.username) self.user.set_password(self.password) self.user.save() self.login()