shuup.testing.modules.mocker package
Submodules
shuup.testing.modules.mocker.mass_actions module
- class shuup.testing.modules.mocker.mass_actions.DummyPicotableMassAction1[source]
Bases:
PicotableMassAction
- label = 'Dummy Mass Action #1'
- identifier = 'dummy_mass_action_1'
- class shuup.testing.modules.mocker.mass_actions.DummyPicotableMassAction2[source]
Bases:
PicotableMassAction
- label = 'Dummy Mass Action #2'
- identifier = 'dummy_mass_action_2'
- class shuup.testing.modules.mocker.mass_actions.DummyMassActionProvider[source]
Bases:
PicotableMassActionProvider
shuup.testing.modules.mocker.mocker_view module
- class shuup.testing.modules.mocker.mocker_view.Mockers[source]
Bases:
object
Namespace object for mocker methods.
The docstrings for the callables are user-visible.
- mock_fully_paid_order_6h(**kwargs)[source]
Create a random order for past 6h (complete and fully paid).
- class shuup.testing.modules.mocker.mocker_view.MockerForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]
Bases:
Form
- base_fields = {'count': <django.forms.fields.IntegerField object>, 'type': <django.forms.fields.ChoiceField object>}
- declared_fields = {'count': <django.forms.fields.IntegerField object>, 'type': <django.forms.fields.ChoiceField object>}
- property media
Return all media required to render the widgets on this form.
- class shuup.testing.modules.mocker.mocker_view.MockerView(**kwargs)[source]
Bases:
FormView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- form_class
alias of
MockerForm
- template_name = 'shuup_testing/mocker.jinja'
- mockers = <shuup.testing.modules.mocker.mocker_view.Mockers object>
shuup.testing.modules.mocker.sections module
- class shuup.testing.modules.mocker.sections.MockContactSection[source]
Bases:
Section
- classmethod visible_for_object(contact, request=None)[source]
Returns whether this sections must be visible for the provided object (e.g.
order
).:return whether this section must be shown in order section list, defaults to false :rtype: bool
- classmethod get_context_data(contact, request=None)[source]
Returns additional information to be used in the template.
To fetch this data in the template, you must first add it to your request’s context
- e.g. `context[admin_order_section.identifier] =
-
admin_order_section.get_context_data(self.object)`
:return additional context data :rtype: object|None
shuup.testing.modules.mocker.toolbar module
- class shuup.testing.modules.mocker.toolbar.MockContactToolbarButton(contact, **kwargs)[source]
Bases:
URLActionButton
- Parameters:
url (str) – The URL to navigate to. For convenience, if this contains no slashes,
reverse
is automatically called on it.
- class shuup.testing.modules.mocker.toolbar.MockShopToolbarButton(shop, **kwargs)[source]
Bases:
URLActionButton
- Parameters:
url (str) – The URL to navigate to. For convenience, if this contains no slashes,
reverse
is automatically called on it.
- class shuup.testing.modules.mocker.toolbar.MockContactToolbarActionItem(object, **kwargs)[source]
Bases:
DropdownItem
- Parameters:
text – The actual text for the button.
icon – Icon CSS class string
disable_reason (str|None) – The reason for this button to be disabled. It’s considered good UX to have an user-visible reason for disabled actions; thus the only way to disable an action is to set the reason. See http://stackoverflow.com/a/372503/51685.
tooltip (str|None) – Tooltip string, if any. May be replaced by the disable reason.
extra_css_class (str) – Extra CSS class(es)
required_permissions (Iterable[str]) – Optional iterable of permission strings
- __init__(object, **kwargs)[source]
- Parameters:
text – The actual text for the button.
icon – Icon CSS class string
disable_reason (str|None) – The reason for this button to be disabled. It’s considered good UX to have an user-visible reason for disabled actions; thus the only way to disable an action is to set the reason. See http://stackoverflow.com/a/372503/51685.
tooltip (str|None) – Tooltip string, if any. May be replaced by the disable reason.
extra_css_class (str) – Extra CSS class(es)
required_permissions (Iterable[str]) – Optional iterable of permission strings
- class shuup.testing.modules.mocker.toolbar.MockProductToolbarActionItem(object, **kwargs)[source]
Bases:
DropdownItem
- Parameters:
text – The actual text for the button.
icon – Icon CSS class string
disable_reason (str|None) – The reason for this button to be disabled. It’s considered good UX to have an user-visible reason for disabled actions; thus the only way to disable an action is to set the reason. See http://stackoverflow.com/a/372503/51685.
tooltip (str|None) – Tooltip string, if any. May be replaced by the disable reason.
extra_css_class (str) – Extra CSS class(es)
required_permissions (Iterable[str]) – Optional iterable of permission strings
- __init__(object, **kwargs)[source]
- Parameters:
text – The actual text for the button.
icon – Icon CSS class string
disable_reason (str|None) – The reason for this button to be disabled. It’s considered good UX to have an user-visible reason for disabled actions; thus the only way to disable an action is to set the reason. See http://stackoverflow.com/a/372503/51685.
tooltip (str|None) – Tooltip string, if any. May be replaced by the disable reason.
extra_css_class (str) – Extra CSS class(es)
required_permissions (Iterable[str]) – Optional iterable of permission strings
- class shuup.testing.modules.mocker.toolbar.MockContactGroupToolbarButton(**kwargs)[source]
Bases:
URLActionButton
- Parameters:
url (str) – The URL to navigate to. For convenience, if this contains no slashes,
reverse
is automatically called on it.
- class shuup.testing.modules.mocker.toolbar.ContactGroupPriceDisplayButtonProvider[source]
Bases:
BaseToolbarButtonProvider
- classmethod get_buttons_for_view(view)[source]
Implement this method to add custom buttons to a view’s toolbar
You can check the view attributes before returning buttons. In case you need to access the request, get it from the view:
view.request
. You can also access the view object when that is available:``` if getattr(view, “object”, None):
yield JavaScriptActionButton(onclick=”window.doSomething()”, text=”Do Something”)
- Parameters:
django.views.View (view) – the view object to add the toolbar.
:rtype iterator|list
Module contents
- class shuup.testing.modules.mocker.TestingAdminModule[source]
Bases:
AdminModule
- Return type: