예제 #1
0
    def test_generates_correct_url_for_task(self, *mocks):
        """The method should return a correct URL for the given Task."""
        task = MagicMock()
        task.id = 15
        task.cycle_task_group.id = 6
        task.cycle_task_group.cycle.id = 77
        task.cycle_task_group.cycle.workflow.id = 9

        result = data_handler.get_cycle_task_url(task)

        expected_url = (u"http://www.foo.com/"
                        u"workflows/9#current_widget"
                        u"/cycle/77"
                        u"/cycle_task_group/6"
                        u"/cycle_task_group_object_task/15")
        self.assertEqual(result, expected_url)
예제 #2
0
  def test_generates_correct_url_for_task(self, *mocks):
    """The method should return a correct URL for the given Task."""
    task = MagicMock()
    task.id = 15
    task.cycle_task_group.id = 6
    task.cycle_task_group.cycle.id = 77
    task.cycle_task_group.cycle.workflow.id = 9

    result = get_cycle_task_url(task)

    expected_url = (
        u"http://www.foo.com/"
        u"workflows/9#current_widget"
        u"/cycle/77"
        u"/cycle_task_group/6"
        u"/cycle_task_group_object_task/15"
    )
    self.assertEqual(result, expected_url)
예제 #3
0
    def test_generates_correct_url_with_filter_if_given(self, *mocks):
        """The method should return a correct URL for the given Task."""
        task = MagicMock()
        task.id = 15
        task.cycle_task_group.id = 6
        task.cycle_task_group.cycle.id = 77
        task.cycle_task_group.cycle.workflow.id = 9

        cycle_filter = u"id=77"

        result = get_cycle_task_url(task, filter_exp=cycle_filter)

        expected_url = (u"http://www.foo.com/"
                        u"workflows/9?filter=id%3D77#current_widget"
                        u"/cycle/77"
                        u"/cycle_task_group/6"
                        u"/cycle_task_group_object_task/15")
        self.assertEqual(result, expected_url)
예제 #4
0
  def test_generates_correct_url_with_filter_if_given(self, *mocks):
    """The method should return a correct URL for the given Task."""
    task = MagicMock()
    task.id = 15
    task.cycle_task_group.id = 6
    task.cycle_task_group.cycle.id = 77
    task.cycle_task_group.cycle.workflow.id = 9

    cycle_filter = u"id=77"

    result = data_handler.get_cycle_task_url(task, filter_exp=cycle_filter)

    expected_url = (
        u"http://www.foo.com/"
        u"workflows/9?filter=id%3D77#current_widget"
        u"/cycle/77"
        u"/cycle_task_group/6"
        u"/cycle_task_group_object_task/15"
    )
    self.assertEqual(result, expected_url)
예제 #5
0
    def test_generates_correct_url_for_task(self, *mocks):
        """The method should return a correct URL for the given Task."""
        result = data_handler.get_cycle_task_url()

        expected_url = u"http://www.foo.com/dashboard#!task"
        self.assertEqual(result, expected_url)
예제 #6
0
  def test_generates_correct_url_for_task(self, *mocks):
    """The method should return a correct URL for the given Task."""
    result = data_handler.get_cycle_task_url()

    expected_url = u"http://www.foo.com/dashboard#!task"
    self.assertEqual(result, expected_url)