shuup.testing.modules.sample_data package

Submodules

shuup.testing.modules.sample_data.data module

shuup.testing.modules.sample_data.factories module

shuup.testing.modules.sample_data.factories.create_sample_category(name, description, business_segment, image_file, shop)[source]
shuup.testing.modules.sample_data.factories.create_sample_product(name, description, business_segment, image_file, shop)[source]

shuup.testing.modules.sample_data.forms module

class shuup.testing.modules.sample_data.forms.SampleObjectsWizardForm(**kwargs)[source]

Bases: Form

BUSINESS_SEGMENT_CHOICES = [('default', 'Default')]
__init__(**kwargs)[source]
base_fields = {'business_segment': <django.forms.fields.ChoiceField object>, 'categories': <django.forms.fields.BooleanField object>, 'products': <django.forms.fields.BooleanField object>}
declared_fields = {'business_segment': <django.forms.fields.ChoiceField object>, 'categories': <django.forms.fields.BooleanField object>, 'products': <django.forms.fields.BooleanField object>}
property media

Return all media required to render the widgets on this form.

class shuup.testing.modules.sample_data.forms.ConsolidateObjectsForm(**kwargs)[source]

Bases: Form

__init__(**kwargs)[source]
base_fields = {}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

shuup.testing.modules.sample_data.manager module

shuup.testing.modules.sample_data.manager.get_installed_business_segment(shop)[source]

Returns the installed business segment

shuup.testing.modules.sample_data.manager.get_installed_products(shop)[source]

Returns the installed products samples list

shuup.testing.modules.sample_data.manager.get_installed_categories(shop)[source]

Returns the installed categories samples list

Returns the installed sample carousel

shuup.testing.modules.sample_data.manager.clear_installed_samples(shop)[source]

Clears all the samples values from the configuration

shuup.testing.modules.sample_data.manager.save_business_segment(shop, business_segment)[source]

Save the business segment identifier

shuup.testing.modules.sample_data.manager.save_products(shop, products_pk)[source]

Save a list of PK as a list of sample products for a shop

shuup.testing.modules.sample_data.manager.save_categories(shop, categories_pk)[source]

Save a list of PK as a list of sample categories for a shop

Save the PK of the sample carousel

shuup.testing.modules.sample_data.manager.has_installed_samples(shop)[source]

Returns whether there is some sample data installed

shuup.testing.modules.sample_data.views module

class shuup.testing.modules.sample_data.views.ConsolidateSampleObjectsView(**kwargs)[source]

Bases: FormView

This view will consolidate all the samples selected by user. All samples which are not in the form will be deleted.

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

form_class

alias of ConsolidateObjectsForm

template_name = 'shuup/admin/sample_data/consolidate_samples.jinja'
form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

class shuup.testing.modules.sample_data.views.SampleObjectsWizardPane(request, object=None)[source]

Bases: WizardPane

identifier = 'sample'
icon = 'shuup_admin/img/configure.png'
title = 'Sample Data'
text = 'To start shopping right now, please install some sample data into your shop'
visible()[source]

Returns whether this pane is visible for editing.

valid()[source]

Returns whether this pane is valid and should be included in wizard pane list.

get_form_defs()[source]
form_valid(form)[source]

Module contents

class shuup.testing.modules.sample_data.SampleDataAdminModule[source]

Bases: AdminModule

get_urls()[source]
Return type:

list[django.urls.RegexURLPattern]

get_menu_entries(request)[source]
Return type:

list[shuup.admin.base.MenuEntry]

get_required_permissions()[source]

Returns a list of required permissions for this module to be enabled :rtype: list[str]

get_notifications(request)[source]

Injects a message to the user and also a notification