Example #1
0
    def testNoSorceStampsProject(self):
        source_stamp = Mock()
        source_stamp.project = None

        master_status = Mock()
        master_status.getTitle = Mock(return_value="test-title")

        self.assertEqual("test-title", mail._defaultMessageProjects([source_stamp], master_status))
Example #2
0
    def testNoSorceStampsProject(self):
        source_stamp = Mock()
        source_stamp.project = None

        master_status = Mock()
        master_status.getTitle = Mock(return_value="test-title")

        self.assertEqual("test-title",
                         mail._defaultMessageProjects([source_stamp],
                                                      master_status))
Example #3
0
    def testMultiSourceStampsProject(self):
        source_stamp1 = Mock()
        source_stamp1.project = "title-a"

        # second source stamp specifies same project as first source stamp
        source_stamp2 = Mock()
        source_stamp2.project = "title-a"

        source_stamp3 = Mock()
        source_stamp3.project = "title-b"

        self.assertEqual(
            "title-a, title-b", mail._defaultMessageProjects([source_stamp1, source_stamp2, source_stamp3], Mock())
        )
Example #4
0
    def testMultiSourceStampsProject(self):
        source_stamp1 = Mock()
        source_stamp1.project = "title-a"

        # second source stamp specifies same project as first source stamp
        source_stamp2 = Mock()
        source_stamp2.project = "title-a"

        source_stamp3 = Mock()
        source_stamp3.project = "title-b"

        self.assertEqual(
            "title-a, title-b",
            mail._defaultMessageProjects(
                [source_stamp1, source_stamp2, source_stamp3], Mock()))
Example #5
0
    def testSingleSourceStampProject(self):
        source_stamp = Mock()
        source_stamp.project = "source-stamp-title"

        self.assertEqual("source-stamp-title", mail._defaultMessageProjects([source_stamp], Mock()))
Example #6
0
    def testSingleSourceStampProject(self):
        source_stamp = Mock()
        source_stamp.project = "source-stamp-title"

        self.assertEqual("source-stamp-title",
                         mail._defaultMessageProjects([source_stamp], Mock()))