示例#1
0
    def test_get_ebook_info(self):
        data = {
            "key": "/books/OL1M",
            "type": {
                "key": "/type/edition"
            },
            "title": "foo"
        }

        e = models.Edition(MockSite(), "/books/OL1M", data=data)
        assert e.get_ebook_info() == {}
示例#2
0
    def test_url(self):
        e = self.mock_edition(models.Edition)
        assert e.url() == "/books/OL1M/foo"
        assert e.url(v=1) == "/books/OL1M/foo?v=1"
        assert e.url(suffix="/add-cover") == "/books/OL1M/foo/add-cover"

        data = {
            "key": "/books/OL1M",
            "type": {"key": "/type/edition"},
        }
        e = models.Edition(MockSite(), "/books/OL1M", data=data)
        assert e.url() == "/books/OL1M/untitled"