当前位置: 首页>>代码示例>>Python>>正文


Python models.UserStory类代码示例

本文整理汇总了Python中agilito.models.UserStory的典型用法代码示例。如果您正苦于以下问题:Python UserStory类的具体用法?Python UserStory怎么用?Python UserStory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了UserStory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

    def setUp(self):
      
        self.p1 = Project(name='Test Project 1')
        self.p2 = Project(name='Test Project 2')
        
        self.p1.save()
        self.p2.save()

        self.p1.project_members.add(User.objects.get(pk=1))
        self.p2.project_members.add(User.objects.get(pk=2))
        self.p2.project_members.add(User.objects.get(pk=3))
        
        self.us1 = UserStory(name='User story A', 
                    planned=45, state=20, project=self.p1)
        self.us2 = UserStory(name='User story B', 
                    planned=30, state=30, project=self.p2)
        
        self.us1.save()
        self.us2.save()

        self.tc1 = TestCase(user_story=self.us1, priority=10)
        self.tc2 = TestCase(user_story=self.us2, priority=10)
        self.tc3 = TestCase(user_story=self.us2, priority=10)

        self.tc1.save()
        self.tc2.save()
        self.tc3.save()
开发者ID:mreperger,项目名称:ajellito,代码行数:27,代码来源:unit.py

示例2: TestUS49Base

class TestUS49Base(SeleniumBase):
    def setUp(self):
        self.user = User(username = 'User A')
        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 tearDown(self):
        self.project.delete()
        self.user.delete()
        super(TestUS49Base, self).tearDown()
开发者ID:httpdss,项目名称:agilito,代码行数:34,代码来源:us49.py

示例3: test_partial_case

    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},
            ]        
        )
开发者ID:mreperger,项目名称:ajellito,代码行数:32,代码来源:unit.py

示例4: test_start_case

 def test_start_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', project=self.p1, iteration = it)
     us2 = UserStory(name='User story B', planned=10, project=self.p1, iteration = it)
     us3 = UserStory(name='User story C', planned=15, project=self.p1, iteration = it)
     us1.save()
     us2.save()
     us3.save()
     self.assertEqual(it.us_accepted_percentage, 0)
开发者ID:mreperger,项目名称:ajellito,代码行数:10,代码来源:unit.py

示例5: test_query_user_story_name

 def test_query_user_story_name(self):
     """ 
     Simple tests just check if there exists a UserStory with a name
     containing the word 'owner'
     """
     query = "name:owner"
     self.assert_(len(UserStory.query(query)) > 0)
开发者ID:mreperger,项目名称:ajellito,代码行数:7,代码来源:unit.py

示例6: setUp

 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()
开发者ID:httpdss,项目名称:ajellito,代码行数:16,代码来源:us21.py

示例7: backlog

def backlog(request, project_id):
    user_stories = UserStory.backlogged(project=project_id).order_by('position')

    planned = sum(i.planned for i in user_stories if i.planned)
    todo = sum(i.remaining for i in user_stories)
    estimated = sum(i.estimated for i in user_stories)
    actuals = sum(i.actuals for i in user_stories)
    failures = sum(i.test_failed for i in user_stories)

    context = AgilitoContext(
        request,
        current_project=project_id,
        dictionary={
            'planned' : planned,
            'remaining' : todo,
            'estimated' : estimated,
            'actuals' : actuals,
            'failures' : failures,
        }
    )

    return list_detail.object_list(
        request,
        user_stories,
        template_name = 'agilito/backlog.html',
        extra_context = context
    )
开发者ID:tutuca,项目名称:revoluciones,代码行数:27,代码来源:base.py

示例8: test_query_user_story_id

 def test_query_user_story_id(self):
     """
     Check if the US30 exists
     """
     query = "id:30"
     result = UserStory.query(query)
     self.assertEqual(len(result), 1)
     self.assertEqual(result[0].id, 30)
开发者ID:mreperger,项目名称:ajellito,代码行数:8,代码来源:unit.py

示例9: setUp

    def setUp(self):
        self.user = User(username='User BBB')
        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()
开发者ID:httpdss,项目名称:ajellito,代码行数:18,代码来源:backlog.py

示例10: TestTaskForm

class TestTaskForm(test.TestCase):
    fixtures = ['database_dump.json']

    def setUp(self):
      
        self.p1 = Project(name='Test Project 1')
        self.p2 = Project(name='Test Project 2')
        
        self.p1.save()
        self.p2.save()

        self.p1.project_members.add(User.objects.get(pk=1))
        self.p2.project_members.add(User.objects.get(pk=2))
        self.p2.project_members.add(User.objects.get(pk=3))
        
        self.us1 = UserStory(name='User story A', 
                    planned=45, state=20, project=self.p1)
        self.us2 = UserStory(name='User story B', 
                    planned=30, state=30, project=self.p2)
        
        self.us1.save()
        self.us2.save()

    def tearDown(self):
    
        for obj in self.us1, self.us2, self.p1, self.p2:
            obj.delete()

    def test_task_form_has_only_relevant_owners_simple(self):
        form = TaskForm(project=self.p1)
        owner_choices = list(form.fields['owner'].choices)
        self.assertEqual(len(owner_choices), 2)
        self.assertEqual(owner_choices[1][1], User.objects.get(pk=1).__str__())

    def test_task_form_has_only_relevant_owners_w_instance_simple(self):
        t1 = Task(name='Task 1 for US A', user_story = self.us1, owner=User.objects.get(pk=2))
        form = TaskForm(project=self.p2, instance=t1)
        owner_choices = list(form.fields['owner'].choices)
        self.assertEqual(len(owner_choices), 3)
        self.assertEqual(owner_choices[1][1], User.objects.get(pk=2).__str__())
        self.assertEqual(owner_choices[2][1], User.objects.get(pk=3).__str__())
开发者ID:mreperger,项目名称:ajellito,代码行数:41,代码来源:unit.py

示例11: test_complete_case

    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},
            ]        
        )
开发者ID:mreperger,项目名称:ajellito,代码行数:35,代码来源:unit.py

示例12: test_edit_change_us

    def test_edit_change_us(self):

        other_story = UserStory(name='DEF', project=self.project,
                                description='a userstory about def',
                                iteration=self.iteration, planned=42, rank=2,
                                state=20, blocked=False)
        other_story.save()

        test_case = TestCase(name='ABC Test', description='Test', priority=10,
                             user_story=self.story)
        test_case.save()

        pk = test_case.id        

        pre = TestCase.objects.count()
        b = self.browser
        b.click("link=Iteration")
        b.wait()
        b.click("link=ABC")
        b.wait()
        b.click("xpath=id('edit_testcase_%d')/a/img" % (test_case.id))
        b.wait()
        b.type("id_name", "hi")
        b.type("id_description", "bye")
        b.select("id_user_story", "US2: DEF")
        self.assertEqual(b.get_selected_label("id_user_story"), "US2: DEF") 
        b.click("css=#content input[type=submit]")
        for i in xrange(15):        
            b.wait()
        self.assertEqual(TestCase.objects.count(), pre)

        # reload test_case
        test_case = TestCase.objects.get(pk=pk)
        self.assertEqual(test_case.name, 'hi')
        self.assertEqual(test_case.description, 'bye')
        self.assertEqual(test_case.user_story.id, other_story.id)

        test_case.delete()
        other_story.delete()
开发者ID:httpdss,项目名称:ajellito,代码行数:39,代码来源:us71.py

示例13: TestUS21

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)
开发者ID:httpdss,项目名称:ajellito,代码行数:38,代码来源:us21.py

示例14: metaWeblog_newPost

def metaWeblog_newPost(blogid, username, password, struct, publish):
    user = authenticate(username, password)

    projectID, category = blogid.split(':')
    project = getProject(user, projectID)

    story = UserStory()
    story.project = project
    story.name = struct['title']
    story.description = struct['description']
    story.save()

    return str(story.id)
开发者ID:mreperger,项目名称:ajellito,代码行数:13,代码来源:__init__.py

示例15: TestTestCaseEditForm

class TestTestCaseEditForm(test.TestCase):
    fixtures = ['database_dump.json']

    def setUp(self):
        self.p1 = Project(name='Test Project 1')
        self.p2 = Project(name='Test Project 2')
        
        self.p1.save()
        self.p2.save()
        
        self.us1 = UserStory(name='User story A', 
                    planned=45, state=20, project=self.p1)
        self.us2 = UserStory(name='User story B', 
                    planned=30, state=30, project=self.p2)
        self.us3 = UserStory(name='User story C', 
                    planned=30, state=30, project=self.p2)
        
        self.us1.save()
        self.us2.save()
        self.us3.save()

        self.tc1 = TestCase(user_story=self.us1, priority=10)
        self.tc2 = TestCase(user_story=self.us2, priority=10)

        self.tc1.save()
        self.tc2.save()


    def tearDown(self):
        for obj in self.tc1, self.tc2, self.us1, self.us2, self.p1, self.p2:
            obj.delete()

    def test_test_case_edit_form_has_current_project_us_only(self):
        form = TestCaseEditForm(project=self.tc1.user_story.project, instance=self.tc1)
        user_story_choices = list(form.fields['user_story'].choices)
        self.assertEqual(len(user_story_choices), 2)
        self.assertEqual(user_story_choices[1][1], unicode(self.us1))

    def test_test_case_edit_form_has_current_project_us_only_other(self):
        form = TestCaseEditForm(project=self.tc2.user_story.project, instance=self.tc2)
        user_story_choices = list(form.fields['user_story'].choices)
        self.assertEqual(len(user_story_choices), 3)
        self.assert_(unicode(self.us2) in set([user_story_choices[1][1], user_story_choices[2][1]]))
        self.assert_(unicode(self.us3) in set([user_story_choices[1][1], user_story_choices[2][1]]))
开发者ID:mreperger,项目名称:ajellito,代码行数:44,代码来源:unit.py


注:本文中的agilito.models.UserStory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。