Esempio n. 1
0
def test_comments_plugin(title):
    shop = factories.get_default_shop()
    product = factories.create_product(
        "product", shop=shop, supplier=factories.get_default_supplier())

    # create 15 reviews for the product
    [create_random_review_for_product(shop, product) for _ in range(15)]

    set_current_theme(ClassicGrayTheme.identifier, shop)
    svc = SavedViewConfig(theme_identifier=ClassicGrayTheme.identifier,
                          shop=shop,
                          view_name="ProductDetailView",
                          status=SavedViewConfigStatus.CURRENT_DRAFT)
    layout = Layout(get_current_theme(shop), "product_bottom")
    layout.add_plugin(ProductReviewCommentsPlugin.identifier,
                      {"title": {
                          "en": title
                      }})
    svc.set_layout_data(layout.placeholder_name, layout)
    svc.save()
    svc.publish()

    client = Client()
    response = client.get(
        reverse("shuup:product", kwargs=dict(pk=product.pk,
                                             slug=product.slug)))
    assert response.status_code == 200
    response.render()
    content = response.content.decode("utf-8")

    assert "product-review-comments" in content
    assert 'data-url="%s"' % reverse('shuup:product_review_comments',
                                     kwargs=dict(pk=product.pk)) in content
    assert 'data-title="%s"' % title in content
Esempio n. 2
0
def test_ratings_plugin(show_recommenders, title):
    shop = factories.get_default_shop()
    product = factories.create_product("product", shop=shop, supplier=factories.get_default_supplier())

    # create 15 reviews for the product
    [create_random_review_for_product(shop, product) for _ in range(15)]

    set_current_theme(ClassicGrayTheme.identifier, shop)
    svc = SavedViewConfig(
        theme_identifier=ClassicGrayTheme.identifier,
        shop=shop,
        view_name="ProductDetailView",
        status=SavedViewConfigStatus.CURRENT_DRAFT
    )
    layout = Layout(get_current_theme(shop), "product_extra_2")
    layout.add_plugin(ProductReviewStarRatingsPlugin.identifier, {
        "customer_ratings_title": {
            "en": title
        },
        "show_recommenders": show_recommenders
    })
    svc.set_layout_data(layout.placeholder_name, layout)
    svc.save()
    svc.publish()

    client = Client()
    response = client.get(reverse("shuup:product", kwargs=dict(pk=product.pk, slug=product.slug)))
    assert response.status_code == 200
    response.render()
    content = response.content.decode("utf-8")

    assert "product-reviews-rating-star" in content
    assert 'class="rating"' in content
    assert ('class="recommend"' in content) == show_recommenders
    assert title in content
Esempio n. 3
0
def get_test_layout_and_svc():
    svc = SavedViewConfig(theme_identifier=FauxTheme.identifier,
                          view_name=printable_gibberish(),
                          status=SavedViewConfigStatus.CURRENT_DRAFT)
    layout = Layout("ph")
    layout.add_plugin("text", {"text": "hello"})
    svc.set_layout_data(layout.placeholder_name, layout)
    svc.save()
    return layout, svc
Esempio n. 4
0
def get_test_layout_and_svc():
    svc = SavedViewConfig(
        theme_identifier=FauxTheme.identifier,
        view_name=printable_gibberish(),
        status=SavedViewConfigStatus.CURRENT_DRAFT
    )
    layout = Layout(FauxTheme, "ph")
    layout.add_plugin("text", {"text_*": "hello"})
    svc.set_layout_data(layout.placeholder_name, layout)
    svc.save()
    return layout, svc
Esempio n. 5
0
    def _handle_xtheme_save(self):
        svc_pk = config.get(self.shop, CONTENT_FOOTER_KEY)
        svc = SavedViewConfig.objects.filter(pk=svc_pk).first()
        theme = get_current_theme(self.shop)

        if not svc and theme:
            context = {"shop": self.shop}
            rendered_content = template_loader.render_to_string(
                content_data.FOOTER_TEMPLATE, context).strip()
            layout = Layout(theme, "footer-bottom")
            # adds the footer template
            layout.begin_row()
            layout.begin_column({"md": 12})
            layout.add_plugin(SnippetsPlugin.identifier,
                              {"in_place": rendered_content})

            svc = SavedViewConfig(theme_identifier=theme.identifier,
                                  shop=self.shop,
                                  view_name=XTHEME_GLOBAL_VIEW_NAME,
                                  status=SavedViewConfigStatus.CURRENT_DRAFT)
            svc.set_layout_data(layout.placeholder_name, layout)
            svc.save()
            svc.publish()

            config.set(self.shop, CONTENT_FOOTER_KEY, svc.pk)
Esempio n. 6
0
    def _handle_xtheme_save(self):
        svc_pk = config.get(self.shop, CONTENT_FOOTER_KEY)
        svc = SavedViewConfig.objects.filter(pk=svc_pk).first()
        theme = get_current_theme(self.shop)

        if not svc and theme:
            context = {"shop": self.shop}
            rendered_content = template_loader.render_to_string(content_data.FOOTER_TEMPLATE, context).strip()
            layout = Layout(theme, "footer-bottom")
            # adds the footer template
            layout.begin_row()
            layout.begin_column({"md": 12})
            layout.add_plugin(SnippetsPlugin.identifier, {"in_place": rendered_content})

            svc = SavedViewConfig(
                theme_identifier=theme.identifier,
                shop=self.shop,
                view_name=XTHEME_GLOBAL_VIEW_NAME,
                status=SavedViewConfigStatus.CURRENT_DRAFT
            )
            svc.set_layout_data(layout.placeholder_name, layout)
            svc.save()
            svc.publish()

            config.set(self.shop, CONTENT_FOOTER_KEY, svc.pk)
Esempio n. 7
0
    def get_placeholder_layout(self, placeholder_name, default_layout=None):
        """
        Get a Layout object for the given placeholder.

        :param placeholder_name: The name of the placeholder to load.
        :type placeholder_name: str
        :param default_layout: Default layout configuration (either a dict or an actual Layout)
        :type default_layout: dict|Layout
        :return: Layout
        :rtype: Layout
        """
        svc = self.saved_view_config
        if svc:
            placeholder_data = svc.get_layout_data(placeholder_name)
            if placeholder_data:
                return Layout.unserialize(data=placeholder_data, placeholder_name=placeholder_name)
        if default_layout:
            if isinstance(default_layout, Layout):
                return default_layout
            return Layout.unserialize(default_layout)
        return Layout(placeholder_name=placeholder_name)
Esempio n. 8
0
def test_render_custom_size_cell(rf):
    request = get_request(edit=False)
    with override_current_theme_class(None):
        with plugin_override():
            with layout_override():
                layout = Layout(FauxTheme, "test")
                gibberish = printable_gibberish()
                layout.begin_column({"md": None, "xs": None, "sm": None})
                layout.add_plugin("text", {"text": "<p>%s</p>" % gibberish})
                jeng = get_jinja2_engine()
                template = jeng.from_string("")
                template.template.name = "test"
                vars = {
                    "view": FauxView(),
                    "request": request
                }
                ctx = template.template.new_context(vars)

                result = six.text_type(render_placeholder(ctx, "test", layout, "test"))
                expect = """
                <div class="placeholder-edit-wrap">
                <div class="xt-ph" id="xt-ph-test">
                <div class="row xt-ph-row">
                <div class="xt-ph-cell"><p>%s</p></div>
                </div>
                </div>
                </div>
                """ % gibberish
                assert close_enough(result, expect)
Esempio n. 9
0
    def get_placeholder_layout(self, placeholder_name, default_layout=None):
        """
        Get a Layout object for the given placeholder.

        :param placeholder_name: The name of the placeholder to load.
        :type placeholder_name: str
        :param default_layout: Default layout configuration (either a dict or an actual Layout)
        :type default_layout: dict|Layout
        :return: Layout
        :rtype: Layout
        """
        svc = self.saved_view_config
        layout = Layout(self.theme, placeholder_name=placeholder_name)
        if svc:
            placeholder_data = svc.get_layout_data(placeholder_name)
            if placeholder_data:
                return layout.unserialize(self.theme, placeholder_data, placeholder_name=placeholder_name)
        if default_layout:
            if isinstance(default_layout, Layout):
                return default_layout
            return layout.unserialize(self.theme, default_layout)
        return layout
Esempio n. 10
0
def test_layout_serialization():
    theme = FauxTheme
    with plugin_override():
        l = Layout(theme, "test")
        l.begin_column({"md": 8})
        l.add_plugin("text", {"text": "yes"})
        serialized = l.serialize()
        expected = {
            "name": "test",
            "rows": [{"cells": [{"config": {"text": "yes"}, "plugin": "text", "sizes": {"md": 8}}]}],
        }
        assert serialized == expected
        assert Layout.unserialize(theme, serialized).serialize() == expected
Esempio n. 11
0
def test_layout_serialization():
    with plugin_override():
        l = Layout("test")
        l.begin_column({"md": 8})
        l.add_plugin("text", {"text": "yes"})
        serialized = l.serialize()
        expected = {
            'name': "test",
            'rows': [
                {
                    'cells': [
                        {'config': {'text': 'yes'}, 'plugin': 'text', 'sizes': {"md": 8}}
                    ]
                }
            ]
        }
        assert serialized == expected
        assert Layout.unserialize(serialized).serialize() == expected
Esempio n. 12
0
def test_layout_serialization():
    theme = FauxTheme
    with plugin_override():
        l = Layout(theme, "test")
        l.begin_column({"md": 8})
        l.add_plugin("text", {"text": "yes"})
        serialized = l.serialize()
        expected = {
            "name":
            "test",
            "rows": [{
                "cells": [{
                    "config": {
                        "text": "yes"
                    },
                    "plugin": "text",
                    "sizes": {
                        "md": 8
                    }
                }]
            }],
        }
        assert serialized == expected
        assert Layout.unserialize(theme, serialized).serialize() == expected
Esempio n. 13
0
    def _create_sample_carousel(cls, shop, business_segment):
        """
        Create the sample carousel for the given business_segment
        and also injects it to the default theme currently being used in front
        """
        if business_segment not in BUSINESS_SEGMENTS:
            return None

        carousel_data = BUSINESS_SEGMENTS[business_segment]["carousel"]
        carousel = create_sample_carousel(carousel_data, business_segment,
                                          shop)

        # injects the carousel plugin with in the front_content placeholder
        # this will only works if the theme have this placeholder, we expect so
        if 'shuup.xtheme' in settings.INSTALLED_APPS:
            from shuup.front.apps.carousel.plugins import CarouselPlugin
            from shuup.xtheme.plugins.products import ProductHighlightPlugin

            from shuup.xtheme.models import SavedViewConfig, SavedViewConfigStatus
            from shuup.xtheme.layout import Layout
            from shuup.xtheme._theme import get_current_theme

            theme = get_current_theme(shop)

            if theme:
                layout = Layout(theme, "front_content")

                # adds the carousel
                layout.begin_row()
                layout.begin_column({"md": 12})
                layout.add_plugin(CarouselPlugin.identifier,
                                  {"carousel": carousel.pk})

                # adds some products
                layout.begin_row()
                layout.begin_column({"md": 12})
                layout.add_plugin(ProductHighlightPlugin.identifier, {})

                svc = SavedViewConfig(
                    theme_identifier=theme.identifier,
                    shop=shop,
                    view_name="IndexView",
                    status=SavedViewConfigStatus.CURRENT_DRAFT)
                svc.set_layout_data(layout.placeholder_name, layout)
                svc.save()
                svc.publish()

        return carousel
Esempio n. 14
0
    def _create_sample_carousel(cls, shop, business_segment):
        """
        Create the sample carousel for the given business_segment
        and also injects it to the default theme currently being used in front
        """
        if business_segment not in BUSINESS_SEGMENTS:
            return None

        carousel_data = BUSINESS_SEGMENTS[business_segment]["carousel"]
        carousel = create_sample_carousel(carousel_data, business_segment, shop)

        # injects the carousel plugin with in the front_content placeholder
        # this will only works if the theme have this placeholder, we expect so
        if 'shuup.xtheme' in settings.INSTALLED_APPS:
            from shuup.front.apps.carousel.plugins import CarouselPlugin
            from shuup.xtheme.plugins.products import ProductHighlightPlugin

            from shuup.xtheme.models import SavedViewConfig, SavedViewConfigStatus
            from shuup.xtheme.layout import Layout
            from shuup.xtheme._theme import get_current_theme

            theme = get_current_theme(shop)

            if theme:
                layout = Layout(theme, "front_content")

                # adds the carousel
                layout.begin_row()
                layout.begin_column({"md": 12})
                layout.add_plugin(CarouselPlugin.identifier, {"carousel": carousel.pk})

                # adds some products
                layout.begin_row()
                layout.begin_column({"md": 12})
                layout.add_plugin(ProductHighlightPlugin.identifier, {})

                svc = SavedViewConfig(
                    theme_identifier=theme.identifier,
                    shop=shop,
                    view_name="IndexView",
                    status=SavedViewConfigStatus.CURRENT_DRAFT
                )
                svc.set_layout_data(layout.placeholder_name, layout)
                svc.save()
                svc.publish()

        return carousel
Esempio n. 15
0
def test_layout_api():
    l = Layout(FauxTheme, "test")
    l.begin_column({"md": 8})
    px0y0 = l.add_plugin("text", {"text": "yes"})
    l.begin_column({"md": 4})
    px1y0 = l.add_plugin("text", {"text": "no"})
    assert len(l) == 1
    assert len(l.rows[0]) == 2
    assert not l.delete_cell(x=0, y=1)  # nonexistent row
    assert l.get_cell(0, 0) == px0y0
    assert l.get_cell(1, 0) == px1y0
    assert not l.get_cell(2, 0)
    assert not l.get_cell(0, 1)
    l.begin_row()
    assert len(l) == 2
    assert len(l.rows[1]) == 0
    l.begin_column()
    assert len(l.rows[1]) == 1
    assert l.delete_cell(x=0, y=1)  # existent cell
    assert not l.delete_cell(x=0, y=1)  # cell existent no more
    assert l.delete_row(1)  # existent row
    assert len(l) == 1
    assert not l.delete_row(1)  # nonexistent row
    l.insert_row(0).add_cell()  # insert a cellful row in first place
    assert len(l) == 2 and list(map(len, l.rows)) == [1, 2]
    l.insert_row(1)  # insert an empty row in second place
    assert len(l) == 3 and list(map(len, l.rows)) == [1, 0, 2]
    assert not l.insert_row(-1)  # that's silly!
    assert l.move_row_to_index(0, 1)
    assert len(l) == 3 and list(map(len, l.rows)) == [0, 1, 2]
    assert l.move_row_to_index(2, 0)
    assert len(l) == 3 and list(map(len, l.rows)) == [2, 0, 1]
    assert not l.move_row_to_index(1, 100)
    assert len(l) == 3 and list(map(len, l.rows)) == [2, 0, 1]
    assert not l.move_row_to_index(1, -1)
    assert len(l) == 3 and list(map(len, l.rows)) == [2, 0, 1]
    cell = l.get_cell(0, 0)
    # top left to bottom right
    assert l.move_cell_to_position(0, 0, 1, 2)
    assert l.get_cell(1, 2) == cell
    assert len(l) == 3 and list(map(len, l.rows)) == [1, 0, 2]
    cell = l.get_cell(0, 0)
    # top left to middle
    assert l.move_cell_to_position(0, 0, 0, 1)
    assert l.get_cell(0, 0) == cell
    assert len(l) == 2 and list(map(len, l.rows)) == [1, 2]
    # invalid cell
    assert not l.move_cell_to_position(0, 100, 0, 1)
    # move to invalid cell
    assert not l.move_cell_to_position(0, 0, 100, 1)
Esempio n. 16
0
def test_carousel_custom_colors(rf):
    from shuup.front.apps.carousel.plugins import CarouselPlugin
    from shuup.utils.django_compat import reverse
    from shuup.xtheme._theme import get_current_theme
    from shuup.xtheme.layout import Layout
    from shuup.xtheme.models import SavedViewConfig, SavedViewConfigStatus

    shop = get_default_shop()
    shop.maintenance_mode = False
    shop.save()

    carousel = Carousel.objects.create(name="test")
    carousel.shops.add(shop)
    test_image = Image.objects.create(original_filename="slide.jpg")
    test_slide = Slide.objects.create(
        carousel=carousel,
        name="test",
        available_from=(datetime.now() - timedelta(days=1)),
        image=test_image,
        target=LinkTargetType.CURRENT,
    )

    theme = get_current_theme(shop)

    # adds the carousel to the front page
    layout = Layout(theme, "front_content")
    layout.begin_row()
    layout.begin_column({"md": 12})
    layout.add_plugin(CarouselPlugin.identifier, {"carousel": carousel.pk})
    svc = SavedViewConfig(
        theme_identifier=theme.identifier, shop=shop, view_name="IndexView", status=SavedViewConfigStatus.CURRENT_DRAFT
    )
    svc.set_layout_data(layout.placeholder_name, layout)
    svc.save()
    svc.publish()

    client = Client()

    # no customized color
    response = client.get(reverse("shuup:index"))
    content = response.content.decode("utf-8")
    assert "owl-carousel" in content
    assert ".owl-nav .owl-prev" not in content
    assert ".owl-nav .owl-next" not in content
    assert ".owl-dot:nth-child(" not in content

    # put colors in arrows
    carousel.arrows_color = "#ffaabb"
    carousel.save()
    response = client.get(reverse("shuup:index"))
    content = response.content.decode("utf-8")
    assert ".owl-nav .owl-prev" in content
    assert ".owl-nav .owl-next" in content
    assert "color: #ffaabb !important;" in content

    # put custom color in dots
    test_slide.inactive_dot_color = "#a1b2c3"
    test_slide.active_dot_color = "#d4e4f6"
    test_slide.save()
    response = client.get(reverse("shuup:index"))
    content = response.content.decode("utf-8")
    assert ".owl-dot:nth-child(1)" in content
    assert "border-color: #a1b2c3 !important" in content
    assert "background-color: #d4e4f6 !important;" in content
Esempio n. 17
0
def test_layout_api():
    l = Layout(FauxTheme, "test")
    l.begin_column({"md": 8})
    px0y0 = l.add_plugin("text", {"text": "yes"})
    l.begin_column({"md": 4})
    px1y0 = l.add_plugin("text", {"text": "no"})
    assert len(l) == 1
    assert len(l.rows[0]) == 2
    assert not l.delete_cell(x=0, y=1)  # nonexistent row
    assert l.get_cell(0, 0) == px0y0
    assert l.get_cell(1, 0) == px1y0
    assert not l.get_cell(2, 0)
    assert not l.get_cell(0, 1)
    l.begin_row()
    assert len(l) == 2
    assert len(l.rows[1]) == 0
    l.begin_column()
    assert len(l.rows[1]) == 1
    assert l.delete_cell(x=0, y=1)  # existent cell
    assert not l.delete_cell(x=0, y=1)  # cell existent no more
    assert l.delete_row(1)  # existent row
    assert len(l) == 1
    assert not l.delete_row(1)  # nonexistent row
    l.insert_row(0).add_cell()  # insert a cellful row in first place
    assert len(l) == 2 and list(map(len, l.rows)) == [1, 2]
    l.insert_row(1)  # insert an empty row in second place
    assert len(l) == 3 and list(map(len, l.rows)) == [1, 0, 2]
    assert not l.insert_row(-1)  # that's silly!
    assert l.move_row_to_index(0, 1)
    assert len(l) == 3 and list(map(len, l.rows)) == [0, 1, 2]
    assert l.move_row_to_index(2, 0)
    assert len(l) == 3 and list(map(len, l.rows)) == [2, 0, 1]
    assert not l.move_row_to_index(1, 100)
    assert len(l) == 3 and list(map(len, l.rows)) == [2, 0, 1]
    assert not l.move_row_to_index(1, -1)
    assert len(l) == 3 and list(map(len, l.rows)) == [2, 0, 1]
    cell = l.get_cell(0, 0)
    # top left to bottom right
    assert l.move_cell_to_position(0, 0, 1, 2)
    assert l.get_cell(1, 2) == cell
    assert len(l) == 3 and list(map(len, l.rows)) == [1, 0, 2]
    cell = l.get_cell(0, 0)
    # top left to middle
    assert l.move_cell_to_position(0, 0, 0, 1)
    assert l.get_cell(0, 0) == cell
    assert len(l) == 2 and list(map(len, l.rows)) == [1, 2]
    # invalid cell
    assert not l.move_cell_to_position(0, 100, 0, 1)
    # move to invalid cell
    assert not l.move_cell_to_position(0, 0, 100, 1)
Esempio n. 18
0
def test_layout_api():
    l = Layout(FauxTheme, "test")
    l.begin_column({"md": 8})
    px0y0 = l.add_plugin("text", {"text": "yes"})
    l.begin_column({"md": 4})
    px1y0 = l.add_plugin("text", {"text": "no"})
    assert len(l) == 1
    assert len(l.rows[0]) == 2
    assert not l.delete_cell(x=0, y=1)  # nonexistent row
    assert l.get_cell(0, 0) == px0y0
    assert l.get_cell(1, 0) == px1y0
    assert not l.get_cell(2, 0)
    assert not l.get_cell(0, 1)
    l.begin_row()
    assert len(l) == 2
    assert len(l.rows[1]) == 0
    l.begin_column()
    assert len(l.rows[1]) == 1
    assert l.delete_cell(x=0, y=1)  # existent cell
    assert not l.delete_cell(x=0, y=1)  # cell existent no more
    assert l.delete_row(1)  # existent row
    assert len(l) == 1
    assert not l.delete_row(1)  # nonexistent row
    l.insert_row(0).add_cell()  # insert a cellful row in first place
    assert len(l) == 2 and list(map(len, l.rows)) == [1, 2]
    l.insert_row(1)  # insert an empty row in second place
    assert len(l) == 3 and list(map(len, l.rows)) == [1, 0, 2]
    assert not l.insert_row(-1)  # that's silly!
Esempio n. 19
0
def test_layout_api():
    l = Layout(FauxTheme, "test")
    l.begin_column({"md": 8})
    px0y0 = l.add_plugin("text", {"text": "yes"})
    l.begin_column({"md": 4})
    px1y0 = l.add_plugin("text", {"text": "no"})
    assert len(l) == 1
    assert len(l.rows[0]) == 2
    assert not l.delete_cell(x=0, y=1)  # nonexistent row
    assert l.get_cell(0, 0) == px0y0
    assert l.get_cell(1, 0) == px1y0
    assert not l.get_cell(2, 0)
    assert not l.get_cell(0, 1)
    l.begin_row()
    assert len(l) == 2
    assert len(l.rows[1]) == 0
    l.begin_column()
    assert len(l.rows[1]) == 1
    assert l.delete_cell(x=0, y=1)  # existent cell
    assert not l.delete_cell(x=0, y=1)  # cell existent no more
    assert l.delete_row(1)  # existent row
    assert len(l) == 1
    assert not l.delete_row(1)  # nonexistent row
    l.insert_row(0).add_cell()  # insert a cellful row in first place
    assert len(l) == 2 and list(map(len, l.rows)) == [1, 2]
    l.insert_row(1)  # insert an empty row in second place
    assert len(l) == 3 and list(map(len, l.rows)) == [1, 0, 2]
    assert not l.insert_row(-1)  # that's silly!
Esempio n. 20
0
def test_carousel_custom_colors(rf):
    from shuup.front.apps.carousel.plugins import CarouselPlugin
    from shuup.xtheme.models import SavedViewConfig, SavedViewConfigStatus
    from shuup.xtheme.layout import Layout
    from shuup.xtheme._theme import get_current_theme
    from django.core.urlresolvers import reverse

    shop = get_default_shop()
    shop.maintenance_mode = False
    shop.save()

    carousel = Carousel.objects.create(name="test")
    carousel.shops.add(shop)
    test_image = Image.objects.create(original_filename="slide.jpg")
    test_slide = Slide.objects.create(
        carousel=carousel, name="test",
        available_from=(datetime.now() - timedelta(days=1)),
        image=test_image, target=LinkTargetType.CURRENT
    )

    theme = get_current_theme(shop)

    # adds the carousel to the front page
    layout = Layout(theme, "front_content")
    layout.begin_row()
    layout.begin_column({"md": 12})
    layout.add_plugin(CarouselPlugin.identifier, {"carousel": carousel.pk})
    svc = SavedViewConfig(
        theme_identifier=theme.identifier,
        shop=shop,
        view_name="IndexView",
        status=SavedViewConfigStatus.CURRENT_DRAFT
    )
    svc.set_layout_data(layout.placeholder_name, layout)
    svc.save()
    svc.publish()

    client = Client()

    # no customized color
    response = client.get(reverse("shuup:index"))
    content = response.content.decode("utf-8")
    assert "owl-carousel" in content
    assert ".owl-nav .owl-prev" not in content
    assert ".owl-nav .owl-next" not in content
    assert ".owl-dot:nth-child(" not in content

    # put colors in arrows
    carousel.arrows_color = "#ffaabb"
    carousel.save()
    response = client.get(reverse("shuup:index"))
    content = response.content.decode("utf-8")
    assert ".owl-nav .owl-prev" in content
    assert ".owl-nav .owl-next" in content
    assert "color: #ffaabb !important;" in content

    # put custom color in dots
    test_slide.inactive_dot_color = "#a1b2c3"
    test_slide.active_dot_color = "#d4e4f6"
    test_slide.save()
    response = client.get(reverse("shuup:index"))
    content = response.content.decode("utf-8")
    assert ".owl-dot:nth-child(1)" in content
    assert "border-color: #a1b2c3 !important" in content
    assert "background-color: #d4e4f6 !important;" in content