Exemplo n.º 1
0
    def setUp(self):
        WLTestCase.setUp(self)
        index = Index()
        index.index.delete_all()
        index.index.commit()

        self.do_doktora = Book.from_xml_file(get_fixture('do-doktora.xml'))
        self.do_anusie = Book.from_xml_file(
            get_fixture('fraszka-do-anusie.xml', catalogue))
Exemplo n.º 2
0
    def setUp(self):
        WLTestCase.setUp(self)
        index = Index()
        index.index.delete_all()
        index.index.commit()

        self.do_doktora = Book.from_xml_file(
            get_fixture('do-doktora.xml'))
        self.do_anusie = Book.from_xml_file(
            get_fixture('fraszka-do-anusie.xml', catalogue))
Exemplo n.º 3
0
    def setUp(self):
        WLTestCase.setUp(self)
        index = Index()
        index.index.delete_all()
        index.index.commit()

        with self.settings(NO_SEARCH_INDEX=False):
            self.do_doktora = Book.from_xml_file(get_fixture('do-doktora.xml'))
            self.do_anusie = Book.from_xml_file(
                get_fixture('fraszka-do-anusie.xml', catalogue))
    def setUp(self):
        WLTestCase.setUp(self)
        index = Index()
        index.index.delete_all()
        index.index.commit()

        with self.settings(NO_SEARCH_INDEX=False):
            self.do_doktora = Book.from_xml_file(
                get_fixture('do-doktora.xml'))
            self.do_anusie = Book.from_xml_file(
                get_fixture('fraszka-do-anusie.xml', catalogue))
Exemplo n.º 5
0
    def setUp(self):
        WLTestCase.setUp(self)

        index = Index()
        self.search = Search()
        index.delete_query(self.search.index.query(uid="*"))
        index.index.commit()

        self.do_doktora = Book.from_xml_file(
            get_fixture('do-doktora.xml', opds))
        self.do_anusie = Book.from_xml_file(
            get_fixture('fraszka-do-anusie.xml', catalogue))
Exemplo n.º 6
0
    def setUp(self):
        WLTestCase.setUp(self)
        self.TEXT = """<utwor />"""
        self.child = BookInfoStub(genre='X-Genre',
                                  epoch='X-Epoch',
                                  kind='X-Kind',
                                  author=PersonStub(("Joe", ), "Doe"),
                                  **info_args("Child"))

        self.parent = BookInfoStub(genre='X-Genre',
                                   epoch='X-Epoch',
                                   kind='X-Kind',
                                   author=PersonStub(("Jim", ), "Lazy"),
                                   cover_url="http://example.com/cover.jpg",
                                   parts=[self.child.url],
                                   **info_args("Parent"))
Exemplo n.º 7
0
    def setUp(self):
        JVM.attachCurrentThread()
        WLTestCase.setUp(self)
        settings.NO_SEARCH_INDEX = False
        settings.SEARCH_INDEX = path.join(settings.MEDIA_ROOT, 'search')

        txt = path.join(path.dirname(__file__), 'files/fraszka-do-anusie.xml')
        self.book = models.Book.from_xml_file(txt)

        index = Index()
        index.open()
        try:
            index.index_book(self.book)
        except:
            index.close()

        self.search = Search()
Exemplo n.º 8
0
 def setUp(self):
     WLTestCase.setUp(self)
     author = PersonStub(("Jane",), "Doe")
     book_info = BookInfoStub(author=author, genre="Genre",
         epoch='Epoch', kind="Kind", **info_args(u"A book"))
     self.book = models.Book.from_text_and_meta(ContentFile('''
         <utwor>
         <opowiadanie>
             <akap>
                 <begin id="b1" />
                 <motyw id="m1">Theme</motyw>
                 Test
                 <end id="e1" />
             </akap>
         </opowiadanie>
         </utwor>
         '''), book_info)
     self.collection = models.Collection.objects.create(
         title='Biblioteczka Boya', slug='boy', book_slugs='a-book')
Exemplo n.º 9
0
    def setUp(self):
        WLTestCase.setUp(self)
        self.TEXT = """<utwor />"""
        self.child = BookInfoStub(
            genre='X-Genre',
            epoch='X-Epoch',
            kind='X-Kind',
            author=PersonStub(("Joe",), "Doe"),
            **info_args("Child")
        )

        self.parent = BookInfoStub(
            genre='X-Genre',
            epoch='X-Epoch',
            kind='X-Kind',
            author=PersonStub(("Jim",), "Lazy"),
            cover_url="http://example.com/cover.jpg",
            parts=[self.child.url],
            **info_args("Parent")
        )
Exemplo n.º 10
0
 def setUp(self):
     WLTestCase.setUp(self)
     author = PersonStub(("Jane", ), "Doe")
     book_info = BookInfoStub(author=author,
                              genre="Genre",
                              epoch='Epoch',
                              kind="Kind",
                              **info_args(u"A book"))
     self.book = models.Book.from_text_and_meta(
         ContentFile('''
         <utwor>
         <opowiadanie>
             <akap>
                 <begin id="b1" />
                 <motyw id="m1">Theme</motyw>
                 Test
                 <end id="e1" />
             </akap>
         </opowiadanie>
         </utwor>
         '''), book_info)
     self.collection = models.Collection.objects.create(
         title='Biblioteczka Boya', slug='boy', book_slugs='a-book')