Offers have covers
[wolnelektury.git] / apps / oai / tests / oaipmhapi.py
index 08925f9..b4947fe 100644 (file)
@@ -19,19 +19,17 @@ class BookMetadataTest(WLTestCase):
         xml = path.join(path.dirname(__file__), 'files/antygona.xml')
         self.book2 = models.Book.from_xml_file(xml)
 
         xml = path.join(path.dirname(__file__), 'files/antygona.xml')
         self.book2 = models.Book.from_xml_file(xml)
 
-        self.catalogue = Catalogue()
         mr = MetadataRegistry()
         mr = MetadataRegistry()
+        self.catalogue = Catalogue(mr)
+
         mr.registerWriter('oai_dc', oai_dc_writer)
         nsmap = {'oai_dc': NS_OAIDC, 'dc': NS_DC, 'xsi': NS_XSI}
         self.xml = XMLTreeServer(self.catalogue, mr, nsmap)
 
     def test_get_record(self):
         mr.registerWriter('oai_dc', oai_dc_writer)
         nsmap = {'oai_dc': NS_OAIDC, 'dc': NS_DC, 'xsi': NS_XSI}
         self.xml = XMLTreeServer(self.catalogue, mr, nsmap)
 
     def test_get_record(self):
-        sch = self.xml.getRecord(record='lubie-kiedy-kobieta',
+        sch = self.xml.getRecord(identifier='lubie-kiedy-kobieta',
                                  metadataPrefix='oai_dc')
                                  metadataPrefix='oai_dc')
-        etree.dump(sch.getroot())
         sch = self.xml.listRecords(metadataPrefix='oai_dc')
         sch = self.xml.listRecords(metadataPrefix='oai_dc')
-        etree.dump(sch.getroot())
 
     def test_selecting(self):
         records, token = self.catalogue.listRecords(**{'set': 'epoch:starozytnosc'})
 
     def test_selecting(self):
         records, token = self.catalogue.listRecords(**{'set': 'epoch:starozytnosc'})
-        print records