blob: 4f39111e7773444e60b1f9b101f509cf796a82d9 [file] [log] [blame]
# Copyright 2014 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Tests for links module."""
import unittest
from codein.logic import task_reminders as task_reminders_logic
from codein.request import links
from seeder import program as program_seeder
from tests import org_utils
from tests import task_utils
class TestLinker(unittest.TestCase):
"""Unit tests for CILinker class."""
def setUp(self):
"""See unittest.TestCase.setUp for specification."""
self.linker = links.CILinker()
def testTaskReminder(self):
"""Tests taskReminder function."""
program = program_seeder.seedGCIProgram()
org = org_utils.seedOrganization(program.key())
task = task_utils.seedTask(program, org, [])
self.assertEqual(
'/tasks/gci/task/reminder/%s/%s' % (
task_reminders_logic.ReminderType.needs_review_reminder.value,
task.key().id()),
self.linker.taskReminder(
task.key(), task_reminders_logic.ReminderType.needs_review_reminder,
'task_reminder_gci_task'))