1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 from catalogue.test_utils import WLTestCase
5 from catalogue import models
6 from oai.handlers import *
7 from oaipmh.server import *
9 from oaipmh.metadata import MetadataRegistry
12 class BookMetadataTest(WLTestCase):
14 super(BookMetadataTest, self).setUp()
15 xml = path.join(path.dirname(__file__), 'files/lubie-kiedy-kobieta.xml')
16 self.book = models.Book.from_xml_file(xml)
18 xml = path.join(path.dirname(__file__), 'files/antygona.xml')
19 self.book2 = models.Book.from_xml_file(xml)
21 mr = MetadataRegistry()
22 self.catalogue = Catalogue(mr)
24 mr.registerWriter('oai_dc', oai_dc_writer)
25 nsmap = {'oai_dc': NS_OAIDC, 'dc': NS_DC, 'xsi': NS_XSI}
26 self.xml = XMLTreeServer(self.catalogue, mr, nsmap)
28 # def test_get_record(self):
29 # self.xml.getRecord(identifier='lubie-kiedy-kobieta', metadataPrefix='oai_dc')
30 # self.xml.listRecords(metadataPrefix='oai_dc')
32 # def test_selecting(self):
33 # records, token = self.catalogue.listRecords(**{'set': 'epoch:starozytnosc'})