Ejemplo n.º 1
0
class CitationManagerTestCase(ptc.PloneTestCase):
    """\
    The core citation test case.
    """

    def afterSetUp(self):
        self.container = {}
        self.manager = CitationManager(self.portal, None)

    def test_0000_general_test(self):
        id1 = u'urn:non_working_example:1'
        self.assertEqual(len(self.manager.getCitation(id1)), 0)

    def test_1000_import_test_registry_fail(self):
        testid = u'urn:example:json:test.cite.1'
        self.assertRaises(ValueError,
            self.manager.importCitationFromId, testid)

    def test_1010_import_test_registry(self):
        registry = zope.component.queryUtility(IRegistry)
        settings = registry.forInterface(ICitationSettings,
            prefix="pmr2.citations.settings", check=False)
        settings.default_path = '/plone/Members/test_user_1_'
        testid = u'urn:example:json:test.cite.1'
        self.manager.importCitationFromId(testid)
        self.assertTrue('testj1' in self.folder)
Ejemplo n.º 2
0
class CitationManagerTestCase(ptc.PloneTestCase):
    """\
    The core citation test case.
    """
    def afterSetUp(self):
        self.container = {}
        self.manager = CitationManager(self.portal, None)

    def test_0000_general_test(self):
        id1 = u'urn:non_working_example:1'
        self.assertEqual(len(self.manager.getCitation(id1)), 0)

    def test_1000_import_test_registry_fail(self):
        testid = u'urn:example:json:test.cite.1'
        self.assertRaises(ValueError, self.manager.importCitationFromId,
                          testid)

    def test_1010_import_test_registry(self):
        registry = zope.component.queryUtility(IRegistry)
        settings = registry.forInterface(ICitationSettings,
                                         prefix="pmr2.citations.settings",
                                         check=False)
        settings.default_path = '/plone/Members/test_user_1_'
        testid = u'urn:example:json:test.cite.1'
        self.manager.importCitationFromId(testid)
        self.assertTrue('testj1' in self.folder)
Ejemplo n.º 3
0
class CitationManagerWithPubmedTestCase(ptc.PloneTestCase):
    """\
    The core citation test case.
    """

    # really don't want this to run unless explicitly specified
    level = 9

    def afterSetUp(self):
        self.container = {}
        self.manager = CitationManager(self.portal, None)

    def test_1010_import_test_registry(self):
        registry = zope.component.queryUtility(IRegistry)
        settings = registry.forInterface(ICitationSettings,
            prefix="pmr2.citations.settings", check=False)
        settings.default_path = '/plone'
        testid = u'urn:miriam:pubmed:17432928'
        self.manager.importCitationFromId(testid)
        self.assertTrue('pmid-17432928' in self.portal)
Ejemplo n.º 4
0
class CitationManagerWithPubmedTestCase(ptc.PloneTestCase):
    """\
    The core citation test case.
    """

    # really don't want this to run unless explicitly specified
    level = 9

    def afterSetUp(self):
        self.container = {}
        self.manager = CitationManager(self.portal, None)

    def test_1010_import_test_registry(self):
        registry = zope.component.queryUtility(IRegistry)
        settings = registry.forInterface(ICitationSettings,
                                         prefix="pmr2.citations.settings",
                                         check=False)
        settings.default_path = '/plone'
        testid = u'urn:miriam:pubmed:17432928'
        self.manager.importCitationFromId(testid)
        self.assertTrue('pmid-17432928' in self.portal)
Ejemplo n.º 5
0
 def afterSetUp(self):
     self.container = {}
     self.manager = CitationManager(self.portal, None)
Ejemplo n.º 6
0
 def afterSetUp(self):
     self.container = {}
     self.manager = CitationManager(self.portal, None)