Beispiel #1
0
    def test_has_visible_sublane(self):
        fantasy, ig = Genre.lookup(self._db, classifier.Fantasy)
        urban_fantasy, ig = Genre.lookup(self._db, classifier.Urban_Fantasy)

        sublane = Lane(
            self._db, "Urban Fantasy", genres=urban_fantasy,
            subgenre_behavior=Lane.IN_SAME_LANE)

        invisible_parent = Lane(
            self._db, "Fantasy", invisible=True, genres=fantasy,
            sublanes=[sublane], subgenre_behavior=Lane.IN_SAME_LANE)

        visible_grandparent = Lane(
            self._db, "English", sublanes=[invisible_parent],
            subgenre_behavior=Lane.IN_SAME_LANE)

        eq_(False, visible_grandparent.has_visible_sublane())
        eq_(True, invisible_parent.has_visible_sublane())
        eq_(False, sublane.has_visible_sublane())