Пример #1
0
    def test_get_default_pid(self, mockpidman):
        mockpidman.create_ark.return_value = self.testark

        obj = Article(Mock())
        obj.label = 'my test object'
        pid = obj.get_default_pid()
        self.assertEqual('%s-test:%s' % (settings.FEDORA_PIDSPACE, self.noid), pid)

        # ark_uri should be stored in dc.identifier
        self.assert_(self.testark in obj.dc.content.identifier_list)

        # ark_uri should be stored in descMetadata.ark_uri
        self.assert_(self.testark in obj.descMetadata.content.ark_uri)

        # ark should be stored in descMetadata.ark
        self.assert_("ark:/%s/%s" % (self.naan, self.noid) in obj.descMetadata.content.ark)
Пример #2
0
    def test_get_default_pid(self, mockpidman):
        mockpidman.create_ark.return_value = self.testark

        obj = Article(Mock())
        obj.label = 'my test object'
        pid = obj.get_default_pid()
        self.assertEqual('%s-test:%s' % (settings.FEDORA_PIDSPACE, self.noid),
                         pid)

        # ark_uri should be stored in dc.identifier
        self.assert_(self.testark in obj.dc.content.identifier_list)

        # ark_uri should be stored in descMetadata.ark_uri
        self.assert_(self.testark in obj.descMetadata.content.ark_uri)

        # ark should be stored in descMetadata.ark
        self.assert_("ark:/%s/%s" %
                     (self.naan, self.noid) in obj.descMetadata.content.ark)
Пример #3
0
 def test_noid(self):
     A = Article(Mock())
     A.pid = "test:efg12"
     self.assertEqual(A.noid, 'efg12')
Пример #4
0
 def test_noid(self):
     A = Article(Mock())
     A.pid="test:efg12"
     self.assertEqual(A.noid, 'efg12')