<s> from __future__ import unicode_literals <EOL> from django . core . urlresolvers import reverse <EOL> from django . contrib . contenttypes . models import ContentType <EOL> from . apps import TaskConfig <EOL> from . models import Goal <EOL> from . models import Task <EOL> from . workflows import TaskWorkflow <EOL> from . workflows import GoalWorkflow <EOL> from djangobmf . utils . testcases import DemoDataMixin <EOL> from djangobmf . utils . testcases import TestCase <EOL> from djangobmf . utils . testcases import ModuleMixin <EOL> from djangobmf . utils . testcases import ModuleTestFactory <EOL> from djangobmf . utils . testcases import WorkflowTestFactory <EOL> class TaskFactory ( ModuleTestFactory , DemoDataMixin , TestCase ) : <EOL> app = TaskConfig <EOL> class GoalWorkflowFactory ( WorkflowTestFactory , DemoDataMixin , TestCase ) : <EOL> workflow = GoalWorkflow <EOL> def test_goal_workflow_superuser ( self ) : <EOL> self . objects [ '<STR_LIT>' ] = Goal ( summary = "<STR_LIT>" ) <EOL> self . auto_workflow_test ( ) <EOL> class TaskWorkflowFactory ( WorkflowTestFactory , DemoDataMixin , TestCase ) : <EOL> workflow = TaskWorkflow <EOL> def test_task_workflow_superuser ( self ) : <EOL> self . objects [ '<STR_LIT>' ] = Task ( summary = "<STR_LIT>" ) <EOL> self . auto_workflow_test ( ) <EOL> class TaskModuleTests ( ModuleMixin , DemoDataMixin , TestCase ) : <EOL> def test_goal_views ( self ) : <EOL> self . model = Goal <EOL> data = self . autotest_ajax_post ( '<STR_LIT>' , kwargs = { '<STR_LIT:key>' : '<STR_LIT:default>' } , data = { '<STR_LIT>' : '<STR_LIT:test>' } ) <EOL> obj = self . get_latest_object ( ) <EOL> a = '<STR_LIT:%s>' % obj <EOL> def test_task_views ( self ) : <EOL> self . model = Task <EOL> data = self . autotest_ajax_post ( '<STR_LIT>' , kwargs = { '<STR_LIT:key>' : '<STR_LIT:default>' } , data = { '<STR_LIT>' : '<STR_LIT:test>' } ) <EOL> obj = self . get_latest_object ( ) <EOL> a = '<STR_LIT:%s>' % obj <EOL> def test_goal_clone1 ( self ) : <EOL> self . model = Goal <EOL> obj = Goal ( summary = "<STR_LIT:test>" ) <EOL> obj . save ( ) <EOL> obj . task_set . create ( summary = "<STR_LIT>" ) <EOL> obj . task_set . create ( summary = "<STR_LIT>" ) <EOL> obj . task_set . create ( summary = "<STR_LIT>" ) <EOL> data = self . autotest_ajax_post ( <EOL> '<STR_LIT>' , <EOL> kwargs = { '<STR_LIT>' : obj . pk } , <EOL> data = { '<STR_LIT>' : '<STR_LIT:test>' } , <EOL> ) <EOL> def test_goal_clone2 ( self ) : <EOL> self . model = Goal <EOL> obj = Goal ( summary = "<STR_LIT:test>" ) <EOL> obj . save ( ) <EOL> obj . task_set . create ( summary = "<STR_LIT>" ) <EOL> obj . task_set . create ( summary = "<STR_LIT>" ) <EOL> obj . task_set . create ( summary = "<STR_LIT>" ) <EOL> data = self . autotest_ajax_post ( <EOL> '<STR_LIT>' , <EOL> kwargs = { '<STR_LIT>' : obj . pk } , <EOL> data = { '<STR_LIT>' : '<STR_LIT:test>' , '<STR_LIT>' : True } , <EOL> ) <EOL> def test_goal_clone3 ( self ) : <EOL> self . model = Goal <EOL> obj = Goal ( summary = "<STR_LIT:test>" ) <EOL> obj . save ( ) <EOL> obj . task_set . create ( summary = "<STR_LIT>" ) <EOL> obj . task_set . create ( summary = "<STR_LIT>" ) <EOL> obj . task_set . create ( summary = "<STR_LIT>" ) <EOL> data = self . autotest_ajax_post ( <EOL> '<STR_LIT>' , <EOL> kwargs = { '<STR_LIT>' : obj . pk } , <EOL> data = { '<STR_LIT>' : '<STR_LIT:test>' , '<STR_LIT>' : True , '<STR_LIT>' : True } , <EOL> ) <EOL> def test_task_workflows ( self ) : <EOL> """<STR_LIT:U+0020>""" <EOL> goal1 = Goal ( summary = "<STR_LIT>" , project_id = <NUM_LIT:1> ) <EOL> goal1 . clean ( ) <EOL> goal1 . save ( ) <EOL> goal2 = Goal ( summary = "<STR_LIT>" , project_id = <NUM_LIT:1> , referee_id = <NUM_LIT:2> ) <EOL> goal2 . clean ( ) <EOL> goal2 . save ( ) <EOL> goal2 . bmfget_customer ( ) <EOL> goal2 . bmfget_project ( ) <EOL> goal3 = Goal ( summary = "<STR_LIT>" ) <EOL> goal3 . clean ( ) <EOL> goal3 . save ( ) <EOL> goal3 . bmfget_customer ( ) <EOL> task1 = Task ( summary = "<STR_LIT>" , goal = goal1 ) <EOL> task1 . clean ( ) <EOL> task1 . save ( ) <EOL> task2 = Task ( summary = "<STR_LIT>" , goal = goal2 ) <EOL> task2 . clean ( ) <EOL> task2 . save ( ) <EOL> task3 = Task ( summary = "<STR_LIT>" , project_id = <NUM_LIT:1> ) <EOL> task3 . clean ( ) <EOL> task3 . save ( ) <EOL> Project = task3 . project . _default_manager <EOL> task3 . get_goal_queryset ( Goal . objects . all ( ) ) <EOL> task4 = Task ( summary = "<STR_LIT>" ) <EOL> task4 . clean ( ) <EOL> task4 . save ( ) <EOL> task5 = Task ( summary = "<STR_LIT>" , due_date = '<STR_LIT>' ) <EOL> task5 . clean ( ) <EOL> task5 . save ( ) <EOL> task5 . get_project_queryset ( Project . all ( ) ) <EOL> task5 . get_goal_queryset ( Goal . objects . all ( ) ) <EOL> task6 = Task ( summary = "<STR_LIT>" , due_date = '<STR_LIT>' , goal = goal1 ) <EOL> task6 . clean ( ) <EOL> task6 . save ( ) <EOL> task6 . get_project_queryset ( Project . all ( ) ) <EOL> task7 = Task ( summary = "<STR_LIT>" , goal = goal1 , employee_id = <NUM_LIT:1> ) <EOL> task7 . clean ( ) <EOL> task7 . save ( ) <EOL> task8 = Task ( summary = "<STR_LIT>" , due_date = '<STR_LIT>' , goal = goal1 ) <EOL> task8 . clean ( ) <EOL> task8 . save ( ) </s>
