+ def assert_publishable(self):
+ assert self.chunk_set.exists(), _('No chunks in the book.')
+ try:
+ changes = self.get_current_changes(publishable=True)
+ except self.NoTextError:
+ raise AssertionError(_('Not all chunks have publishable revisions.'))
+ book_xml = self.materialize(changes=changes)
+
+ from librarian.dcparser import BookInfo
+ from librarian import NoDublinCore, ParseError, ValidationError
+
+ try:
+ bi = BookInfo.from_string(book_xml.encode('utf-8'))
+ except ParseError, e:
+ raise AssertionError(_('Invalid XML') + ': ' + str(e))
+ except NoDublinCore:
+ raise AssertionError(_('No Dublin Core found.'))
+ except ValidationError, e:
+ raise AssertionError(_('Invalid Dublin Core') + ': ' + str(e))
+
+ valid_about = self.correct_about()
+ assert bi.about == valid_about, _("rdf:about is not") + " " + valid_about