def testOneNameAuthorCitation(self):
     from collective.contentlicensing.browser import CopyrightBylineView
     self.setRoles(['Manager'])
     self.portal.invokeFactory('Document','doc1')
     doc1 = getattr(self.portal,'doc1')
     doc1.setTitle('Test Course 04')
     doc1.setCreators('Rossum')
     view = CopyrightBylineView(doc1,self.app.REQUEST)
     info = view.getCitationInfo()
     assert (info.find('Rossum. (') == 0)
     assert (info.find('Test Course 04') > -1)
     assert (info.find('http://nohost/plone/doc1') > -1)
 def testThreeAuthorCitation(self):
     from collective.contentlicensing.browser import CopyrightBylineView
     self.setRoles(['Manager'])
     self.portal.invokeFactory('Document','doc1')
     doc1 = getattr(self.portal,'doc1')
     doc1.setTitle('Test Course 04')
     doc1.setCreators('Piotr Tchaikovsky\nWinter Daydreams\nLon Pathetique\nGuido Van Rossum')
     view = CopyrightBylineView(doc1,self.app.REQUEST)
     info = view.getCitationInfo()
     assert (info.find('Tchaikovsky, P., Daydreams, W., Pathetique, L., Rossum, G. V. (') == 0)
     assert (info.find('Test Course 04') > -1)
     assert (info.find('http://nohost/plone/doc1') > -1)
    def testOneNameAuthorCitation(self):
        from collective.contentlicensing.browser import CopyrightBylineView

        self.setRoles(["Manager"])
        self.portal.invokeFactory("Document", "doc1")
        doc1 = getattr(self.portal, "doc1")
        doc1.setTitle("Test Course 04")
        doc1.setCreators("Rossum")
        view = CopyrightBylineView(doc1, self.app.REQUEST)
        info = view.getCitationInfo()
        assert info.find("Rossum. (") == 0
        assert info.find("Test Course 04") > -1
        assert info.find("http://nohost/plone/doc1") > -1
    def testThreeAuthorCitation(self):
        from collective.contentlicensing.browser import CopyrightBylineView

        self.setRoles(["Manager"])
        self.portal.invokeFactory("Document", "doc1")
        doc1 = getattr(self.portal, "doc1")
        doc1.setTitle("Test Course 04")
        doc1.setCreators("Piotr Tchaikovsky\nWinter Daydreams\nLon Pathetique\nGuido Van Rossum")
        view = CopyrightBylineView(doc1, self.app.REQUEST)
        info = view.getCitationInfo()
        assert info.find("Tchaikovsky, P., Daydreams, W., Pathetique, L., Rossum, G. V. (") == 0
        assert info.find("Test Course 04") > -1
        assert info.find("http://nohost/plone/doc1") > -1