def create_project_default_columns(sender, **kwargs): if kwargs['created']: KanbanColumn(name='Todo', type='ToDo', project=kwargs['instance']).save() KanbanColumn(name='In Progress', type='InProgress', project=kwargs['instance']).save() KanbanColumn(name='Done', type='Done', project=kwargs['instance']).save()
def setUp(self): self.client.force_login(self.user) # NOTE: this element gets modified by some of those tests, so this shall NOT be created in setUpTestData() self.project = Project(creator=self.user, name_short='PRJ') self.project.save() self.project.developer.add(self.user) self.project.developer.add(self.user2) # NOTE: this element gets modified by some of those tests, so this shall NOT be created in setUpTestData() self.kanbancol = KanbanColumn(project=self.project, position=4, name='test') self.kanbancol.save() # NOTE: this element gets modified by some of those tests, so this shall NOT be created in setUpTestData() self.issue = Issue( title='a very very very very very very very long issue title', project=self.project, due_date='2016-12-16', kanbancol=self.kanbancol, storypoints='3') self.issue.save() self.issue2 = Issue(title='issue title', project=self.project, due_date='2016-12-16', kanbancol=self.kanbancol, storypoints='3') self.issue2.save() self.issue.assignee.add(self.user)
def test_add_and_remove_issue_from_sprint(self): kanbancol = KanbanColumn(name='Column', position=1, project=self.project) kanbancol.save() issue = Issue(title="Test-Issue", kanbancol=kanbancol, project=self.project, type="Bug") issue.save() # add to sprint response = self.client.post(reverse('sprint:assigntosprint', kwargs={'project': self.project.name_short}), {'sqn_i': issue.number}, follow=True, HTTP_REFERER=reverse('backlog:backlog', kwargs={'project': self.project.name_short})) self.assertRedirects(response, reverse('backlog:backlog', kwargs={'project': self.project.name_short, 'sqn_s': self.sprint.seqnum})) self.assertEqual(Issue.objects.get(pk=issue.pk).sprint, Sprint.objects.get(pk=self.sprint.pk)) # remove from sprint response = self.client.post(reverse('sprint:assigntosprint', kwargs={'project': self.project.name_short}), {'sqn_s': self.sprint.seqnum, 'sqn_i': issue.number}, follow=True, HTTP_REFERER=reverse('backlog:backlog', kwargs={'project': self.project.name_short}) ) self.assertRedirects(response, reverse('backlog:backlog', kwargs={'project': self.project.name_short, 'sqn_s': self.sprint.seqnum})) self.assertEqual(Issue.objects.get(pk=issue.pk).sprint, None)
def setUp(self): self.client.force_login(self.user) # NOTE: this element gets modified by some of those tests, so this shall NOT be created in setUpTestData() self.project = Project(creator=self.user, name_short='PRJ', activity_only_for_managers=False) self.project.save() self.project.developer.add(self.user) self.project2 = Project(creator=self.user, activity_only_for_managers=True, name_short='PRJJ') self.project2.save() self.project2.manager.add(self.user) self.project2.developer.add(self.user, self.user2) # NOTE: this element gets modified by some of those tests, so this shall NOT be created in setUpTestData() self.kanbancol = KanbanColumn(project=self.project, position=4, name='test') self.kanbancol.save() # NOTE: this element gets modified by some of those tests, so this shall NOT be created in setUpTestData() self.issue = Issue(title='a very very very very very very very long issue title', project=self.project, due_date='2016-12-16', kanbancol=self.kanbancol, storypoints='3' ) self.issue.save() self.issue.assignee.add(self.user) self.issue2 = Issue(title='second_issue', project=self.project) self.issue2.save() self.issue2.assignee.add(self.user) self.time = now().strftime("%Y-%m-%d %H:%M:%S")
def setUp(self): self.client.force_login(self.user) # NOTE: these elements get modified by some testcases, so they should NOT be created in setUpTestData() self.project = Project(creator=self.user, name_short='PRJ', activity_only_for_managers=False) self.project.save() self.project.developer.add(self.user) self.project2 = Project(creator=self.user, activity_only_for_managers=True, name_short='PRJJ') self.project2.save() self.project2.manager.add(self.user) self.project2.developer.add(self.user, self.user2) self.kanbancol = KanbanColumn(project=self.project, position=4, name='test') self.kanbancol.save() self.issue = Issue(title='a very very very very very very very long issue title', project=self.project, due_date='2016-12-16', kanbancol=self.kanbancol, storypoints='3' ) self.issue.save() self.issue.assignee.add(self.user) self.issue2 = Issue(title='second_issue', project=self.project) self.issue2.save() self.issue2.assignee.add(self.user) self.time = now().strftime("%Y-%m-%d %H:%M:%S") # success logedit_address_kwargs self.sqn_l1_address_kwarg = {"project": self.issue.project.name_short, "sqn_i": self.issue.number, "sqn_l": 1 }
def setUp(self): self.user = get_user_model().objects.create_user('a', 'b', 'c') self.project = Project(creator=self.user, name="asdf", name_short="PRJ") self.project.save() self.project.manager.add(self.user) self.project.developer.add(self.user) self.project2 = Project(creator=self.user, name="2ndproj", name_short="PRJ2") self.project2.save() self.project2.developer.add(self.user) self.kanban = KanbanColumn(name='KanCol', project=self.project2, position=4) self.kanban.save() # Uses the cookie hack from: # https://stackoverflow.com/questions/22494583/login-with-code-when-using-liveservertestcase-with-django client = Client() client.login(username='******', password='******') self.cookie = client.cookies['sessionid'] self.selenium.get("{}{}".format(self.live_server_url, reverse('invite_users:invite_users'))) self.selenium.add_cookie({ 'name': 'sessionid', 'value': self.cookie.value, 'secure': False, 'path': '/' }) self.selenium.refresh()
def setUpTestData(cls): # NOTE: if you modify those element they need to be created in setUp, instead of here cls.user = get_user_model().objects.create_user('test', '*****@*****.**', 'test1234') cls.project = Project(creator=cls.user, name_short='PRJ') cls.project.save() cls.project.developer.add(cls.user) cls.kanbancol = KanbanColumn(project=cls.project, position=4, name='test') cls.kanbancol.save()
def setUp(self): self.client.force_login(self.user) # NOTE: these elements get modified by some testcases, so they should NOT be created in setUpTestData() self.project = Project(creator=self.user, name_short='PRJ') self.project.save() self.project.manager.add(self.user) self.project.developer.add(self.user) self.column = KanbanColumn(name='Column', position=4, project=self.project) self.column.save()
def setUp(self): # NOTE: these element gets modified by some of those tests, so they should NOT be created in setUpTestData() self.client.force_login(self.user) self.project = Project(creator=self.user, name_short=proj_short) self.project.save() self.project.manager.add(self.user) self.project.developer.add(self.user) self.column = KanbanColumn(name='Column', position=4, project=self.project) self.column.save() self.issue = Issue(title="Test-Issue", project=self.project, kanbancol=self.column, type="Bug") self.issue.save()
def setUp(self): translation.activate('en') self.client.force_login(self.user) self.project = Project(creator=self.user, name_short='test', name='Testproject', description='asdf') self.project.save() self.project.manager.add(self.user) self.column = KanbanColumn(name='Column', project=self.project) self.column.save()
def setUp(self): self.client.force_login(self.user) # NOTE: this element gets modified by some of those tests, so this shall NOT be created in setUpTestData() self.project = Project(creator=self.user, name_short=proj_short) self.project.save() self.project.manager.add(self.user) self.project.developer.add(self.user) # NOTE: this element gets modified by some of those tests, so this shall NOT be created in setUpTestData() self.column = KanbanColumn(name='Column', position=4, project=self.project) self.column.save()
def setUp(self): # NOTE: these elements get modified by some testcases, so they should NOT be created in setUpTestData() translation.activate('en') self.client.force_login(self.user) self.project = Project(creator=self.user, name_short='test', name='Testproject', description='asdf') self.project.save() self.project.manager.add(self.user) self.column = KanbanColumn(name='Column', project=self.project) self.column.save()
def test_flags(self): kanbancol = KanbanColumn(name='Column', position=1, project=self.project) kanbancol.save() issue = Issue(title="Test-Issue", kanbancol=kanbancol, project=self.project, type="Bug", sprint=self.sprint) issue.save() self.assertEqual(issue.was_in_sprint, False) response = self.client.post( reverse('sprint:stopsprint', kwargs={'project': self.project.name_short, 'sqn_s': self.sprint.seqnum})) self.assertEqual(Issue.objects.get(pk=issue.pk).was_in_sprint, True) issue.save() # unset the flag self.assertEqual(issue.was_in_sprint, False)
def setUpTestData(cls): # NOTE: if you modify these elements they need to be created in setUp(), instead of here cls.user = get_user_model().objects.create_user('test', '*****@*****.**', 'test1234') cls.project = Project(creator=cls.user, name_short='PRJ') cls.project.save() cls.project.developer.add(cls.user) cls.kanbancol = KanbanColumn(project=cls.project, position=4, name='test') cls.kanbancol.save() cls.issue = Issue(project=cls.project, due_date='2016-12-16', kanbancol=cls.kanbancol, storypoints='3') cls.issue.save() cls.issue2 = Issue(project=cls.project, due_date='2016-12-16', kanbancol=cls.kanbancol, storypoints='3') cls.time = timezone.now().replace(microsecond=100000) cls.timestamp = cls.time.timestamp()
def test_storypoints_in_backlog(self): kanbancol = KanbanColumn(name='Column', position=1, project=self.project) kanbancol.save() issue = Issue(title="Test-Issue", kanbancol=kanbancol, project=self.project, type="Bug", sprint=self.sprint) issue.save() response = self.client.get( reverse('backlog:backlog', kwargs={'project': self.project.name_short})) self.assertNotContains(response, 'Storypoints:') issue.storypoints = 5 issue.save() response = self.client.get( reverse('backlog:backlog', kwargs={'project': self.project.name_short})) self.assertNotContains(response, 'Storypoints:') issue.assignee.add(self.user) response = self.client.get( reverse('backlog:backlog', kwargs={'project': self.project.name_short})) self.assertContains(response, 'Storypoints:') self.assertContains(response, str(self.user.username) + ': 5') user2 = get_user_model().objects.create_user('a2', 'b2', 'c2') user2.save() self.project.developer.add(user2) issue.assignee.add(user2) response = self.client.get( reverse('backlog:backlog', kwargs={'project': self.project.name_short})) self.assertContains(response, str(user2.username) + ': 2.5') self.assertContains(response, str(self.user.username) + ': 2.5') issue2 = Issue(title="Test-Issue", kanbancol=kanbancol, project=self.project, type="Bug", sprint=self.sprint, storypoints=5) issue2.save() issue2.assignee.add(self.user) response = self.client.get( reverse('backlog:backlog', kwargs={'project': self.project.name_short})) self.assertContains(response, str(user2.username) + ': 2.5') self.assertContains(response, str(self.user.username) + ': 7.5')
def setUpTestData(cls): # NOTE: if you modify these elements they need to be created in setUp(), instead of here cls.user = get_user_model().objects.create_user( 'test', '*****@*****.**', 'test1234') cls.project = Project(creator=cls.user, name_short='PRJ') cls.project.save() cls.project.developer.add(cls.user) cls.project2 = Project(creator=cls.user, name_short='PRJ2') cls.project2.save() cls.project2.developer.add(cls.user) cls.kanbancol = KanbanColumn(project=cls.project, position=4, name='test') cls.kanbancol.save() cls.time = timezone.now().replace(microsecond=100000) cls.timestring = cls.time.strftime("%Y-%m-%d %H:%M:%S") cls.timestamp = cls.time.timestamp()
def setUp(self): # NOTE: these elements get modified by some testcases, so they should NOT be created in setUpTestData() self.user = get_user_model().objects.create_user('a', 'b', 'c') self.user.first_name = 'Alice' self.user.last_name = 'Bla' self.user.save() self.user2 = get_user_model().objects.create_user('d', 'e', 'f') self.user2.first_name = 'Bob' self.user2.last_name = 'Blub' self.user2.save() self.project = Project(creator=self.user, name_short='PRJ') self.project.save() self.project2 = Project(creator=self.user, name_short='TPJ') self.project2.save() self.project.developer.add(self.user) self.project2.developer.add(self.user) self.project.developer.add(self.user2) kanbancol = KanbanColumn(project=self.project, position=4, name='ReallyDone') kanbancol.save()
def setUp(self): self.user = get_user_model().objects.create_user('a', 'b', 'c') self.user.first_name = 'Alice' self.user.last_name = 'Bla' self.user.save() self.user2 = get_user_model().objects.create_user('d', 'e', 'f') self.user2.first_name = 'Bob' self.user2.last_name = 'Blub' self.user2.save() self.project = Project(creator=self.user, name_short='PRJ') self.project.save() self.project2 = Project(creator=self.user, name_short='TPJ') self.project2.save() self.project.developer.add(self.user) self.project2.developer.add(self.user) self.project.developer.add(self.user2) kanbancol = KanbanColumn(project=self.project, position=4, name='ReallyDone') kanbancol.save()
def setUp(self): self.client.force_login(self.user) # create a default project project_settings["manager"] = (self.user.pk) self.client.post(reverse('project:create'), project_settings) self.project = Project.objects.filter( name_short=project_settings['name_short']).first() # create a kanban column for the issue self.column = KanbanColumn(name='Column', position=4, project=self.project) self.column.save() # create an issue issue_settings['kanbancol'] = self.column.pk self.client.post( reverse('issue:create', kwargs={'project': self.project.name_short}), issue_settings) self.issue = Issue.objects.filter(project=self.project.pk).first()
def setUpTestData(cls): # NOTE: if you modify those elements they need to be created in setUp, instead of here cls.user = get_user_model().objects.create_user( 'test', '*****@*****.**', 'test1234') cls.user2 = get_user_model().objects.create_user( 'tast', '*****@*****.**', 'test1234') cls.user3 = get_user_model().objects.create_user( 'tust', '*****@*****.**', 'test1234') cls.project = Project(creator=cls.user, name_short=proj_short) cls.project.save() cls.project.developer.add(cls.user) cls.tag1 = Tag(project=cls.project, tag_text='backend', color='RED') cls.tag2 = Tag(project=cls.project, tag_text='frontend', color='BLUE') cls.tag1.save() cls.tag2.save() cls.kanbancol = KanbanColumn(project=cls.project, position=4, name='test') cls.kanbancol.save()
def setUp(self): self.client.force_login(self.user) # NOTE: these elements get modified by some testcases, so they should NOT be created in setUpTestData() # create a default project project_settings["manager"] = (self.user.pk) self.client.post(reverse('project:create'), project_settings) self.project = Project.objects.filter( name_short=project_settings['name_short']).first() # create a kanban column for the issue self.column = KanbanColumn(name='Column', position=4, project=self.project) self.column.save() # create an issue issue_settings['kanbancol'] = self.column.pk self.client.post( reverse('issue:create', kwargs={'project': self.project.name_short}), issue_settings) self.issue = Issue.objects.filter(project=self.project.pk).first()