mirror of
https://github.com/pretix/pretix.git
synced 2026-08-05 09:57:49 +00:00
Talk about 'products', not 'items'
This commit is contained in:
+18
-16
@@ -352,12 +352,12 @@ class Event(Versionable):
|
||||
presale_end = models.DateTimeField(
|
||||
null=True, blank=True,
|
||||
verbose_name=_("End of presale"),
|
||||
help_text=_("No items will be sold after this date."),
|
||||
help_text=_("No products will be sold after this date."),
|
||||
)
|
||||
presale_start = models.DateTimeField(
|
||||
null=True, blank=True,
|
||||
verbose_name=_("Start of presale"),
|
||||
help_text=_("No items will be sold before this date."),
|
||||
help_text=_("No products will be sold before this date."),
|
||||
)
|
||||
payment_term_days = models.PositiveIntegerField(
|
||||
default=14,
|
||||
@@ -433,7 +433,7 @@ class EventPermission(Versionable):
|
||||
)
|
||||
can_change_items = models.BooleanField(
|
||||
default=True,
|
||||
verbose_name=_("Can change item settings")
|
||||
verbose_name=_("Can change product settings")
|
||||
)
|
||||
|
||||
class Meta:
|
||||
@@ -466,8 +466,8 @@ class ItemCategory(Versionable):
|
||||
)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("Item category")
|
||||
verbose_name_plural = _("Item categories")
|
||||
verbose_name = _("Product category")
|
||||
verbose_name_plural = _("Product categories")
|
||||
ordering = ('position', 'id')
|
||||
|
||||
def __str__(self):
|
||||
@@ -507,8 +507,8 @@ class Property(Versionable):
|
||||
)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("Item property")
|
||||
verbose_name_plural = _("Item properties")
|
||||
verbose_name = _("Product property")
|
||||
verbose_name_plural = _("Product properties")
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
@@ -623,7 +623,9 @@ class Question(Versionable):
|
||||
class Item(Versionable):
|
||||
"""
|
||||
An item is a thing which can be sold. It belongs to an
|
||||
event and may or may not belong to a category.
|
||||
event and may or may not belong to a category. Items are often
|
||||
also called 'products' but are named 'items' internally due to
|
||||
historic reasons.
|
||||
|
||||
It has a default price which might by overriden by
|
||||
restrictions.
|
||||
@@ -656,7 +658,7 @@ class Item(Versionable):
|
||||
deleted = models.BooleanField(default=False)
|
||||
short_description = models.TextField(
|
||||
verbose_name=_("Short description"),
|
||||
help_text=_("This is shown below the item name in lists."),
|
||||
help_text=_("This is shown below the product name in lists."),
|
||||
null=True, blank=True,
|
||||
)
|
||||
long_description = models.TextField(
|
||||
@@ -697,15 +699,15 @@ class Item(Versionable):
|
||||
admission = models.BooleanField(
|
||||
verbose_name=_("Is an admission ticket"),
|
||||
help_text=_(
|
||||
'Whether or not this item allows a person to enter '
|
||||
'Whether or not buying this product allows a person to enter '
|
||||
'your event'
|
||||
),
|
||||
default=False
|
||||
)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("Item")
|
||||
verbose_name_plural = _("Items")
|
||||
verbose_name = _("Product")
|
||||
verbose_name_plural = _("Products")
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
@@ -909,8 +911,8 @@ class ItemVariation(Versionable):
|
||||
)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("Item variation")
|
||||
verbose_name_plural = _("Item variations")
|
||||
verbose_name = _("Product variation")
|
||||
verbose_name_plural = _("Product variations")
|
||||
|
||||
def __str__(self):
|
||||
return str(self.to_variation_dict())
|
||||
@@ -1412,7 +1414,7 @@ class OrderPosition(ObjectWithAnswers, Versionable):
|
||||
max_length=255,
|
||||
verbose_name=_("Attendee name"),
|
||||
blank=True, null=True,
|
||||
help_text=_("Empty, if this item is not an admission ticket")
|
||||
help_text=_("Empty, if this product is not an admission ticket")
|
||||
)
|
||||
|
||||
class Meta:
|
||||
@@ -1478,7 +1480,7 @@ class CartPosition(ObjectWithAnswers, Versionable):
|
||||
max_length=255,
|
||||
verbose_name=_("Attendee name"),
|
||||
blank=True, null=True,
|
||||
help_text=_("Empty, if this item is not an admission ticket")
|
||||
help_text=_("Empty, if this product is not an admission ticket")
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<li>
|
||||
<a href="{% url 'control:event.items' organizer=request.event.organizer.slug event=request.event.slug %}"
|
||||
{% if "event.items" == url_name or "event.item." in url_name or url_name == "event.item" %}class="active"{% endif %}>
|
||||
{% trans "Items" %}</a>
|
||||
{% trans "Products" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url 'control:event.items.quotas' organizer=request.event.organizer.slug event=request.event.slug %}"
|
||||
@@ -78,14 +78,6 @@
|
||||
<a href="#">
|
||||
<i class="fa fa-shopping-cart fa-fw"></i>
|
||||
{% trans "Orders" %}
|
||||
<span class="fa arrow"></span>
|
||||
</a>
|
||||
<ul class="nav nav-second-level">
|
||||
<li>
|
||||
<a href="{% url 'control:event.items' organizer=request.event.organizer.slug event=request.event.slug %}">
|
||||
{% trans "View orders" %}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
{% extends "pretixcontrol/event/base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{{ item.name }} :: {% trans "Item" %}{% endblock %}
|
||||
{% block title %}{{ item.name }} :: {% trans "Product" %}{% endblock %}
|
||||
{% block content %}
|
||||
{% if item.identity %}
|
||||
<h1>{% trans "Modify item:" %} {{ item.name }}</h1>
|
||||
<h1>{% trans "Modify product:" %} {{ item.name }}</h1>
|
||||
<ul class="nav nav-pills">
|
||||
<li {% if "event.item" == url_name %}class="active"{% endif %}><a href="{% url 'control:event.item' organizer=request.event.organizer.slug event=request.event.slug item=item.identity %}">{% trans "General information" %}</a></li>
|
||||
<li {% if "event.item.variations" == url_name %}class="active"{% endif %}><a href="{% url 'control:event.item.variations' organizer=request.event.organizer.slug event=request.event.slug item=item.identity %}">{% trans "Variations" %}</a></li>
|
||||
<li {% if "event.item.restrictions" == url_name %}class="active"{% endif %}><a href="{% url 'control:event.item.restrictions' organizer=request.event.organizer.slug event=request.event.slug item=item.identity %}">{% trans "Restrictions" %}</a></li>
|
||||
</ul>
|
||||
{% else %}
|
||||
<h1>{% trans "Create item" %}</h1>
|
||||
<h1>{% trans "Create product" %}</h1>
|
||||
<p>{% blocktrans trimmed %}
|
||||
You will be able to adjust further settings in the next step.
|
||||
{% endblocktrans %}</p>
|
||||
@@ -18,8 +18,8 @@
|
||||
{% if item.identity and not item.quotas.exists %}
|
||||
<div class="alert alert-warning">
|
||||
{% blocktrans trimmed %}
|
||||
Please note, that your item will <strong>not</strong> be available for sale until you added your item
|
||||
to an existing or newly created quota.
|
||||
Please note, that your product will <strong>not</strong> be available for sale until you added your
|
||||
item to an existing or newly created quota.
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{% load formset_tags %}
|
||||
{% block inside %}
|
||||
<p>{% blocktrans trimmed %}
|
||||
In this area, you can choose of a set of "restriction types" to restrict the availability of your item with
|
||||
In this area, you can choose of a set of "restriction types" to restrict the availability of your product with
|
||||
certain conditions.
|
||||
{% endblocktrans %}</p>
|
||||
<form action="" method="post">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "pretixcontrol/event/base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Items" %}{% endblock %}
|
||||
{% block title %}{% trans "Products" %}{% endblock %}
|
||||
{% block content %}
|
||||
{% block inside %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Item categories" %}{% endblock %}
|
||||
{% block title %}{% trans "Product categories" %}{% endblock %}
|
||||
{% block inside %}
|
||||
<h1>{% trans "Item categories" %}</h1>
|
||||
<h1>{% trans "Product categories" %}</h1>
|
||||
{% if "updated" in request.GET %}
|
||||
<div class="alert alert-success">
|
||||
{% trans "Your changes have been saved." %}
|
||||
@@ -22,7 +22,7 @@
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Item categories" %}</th>
|
||||
<th>{% trans "Product categories" %}</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block title %}{% trans "Item category" %}{% endblock %}
|
||||
{% block title %}{% trans "Product category" %}{% endblock %}
|
||||
{% block inside %}
|
||||
<h1>{% trans "Item category" %}</h1>
|
||||
<h1>{% trans "Product category" %}</h1>
|
||||
<form action="" method="post" class="form-horizontal">
|
||||
{% csrf_token %}
|
||||
{% if "success" in request.GET %}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block title %}{% trans "Delete item category" %}{% endblock %}
|
||||
{% block title %}{% trans "Delete product category" %}{% endblock %}
|
||||
{% block inside %}
|
||||
<h1>{% trans "Delete item category" %}</h1>
|
||||
<h1>{% trans "Delete product category" %}</h1>
|
||||
<form action="" method="post" class="form-horizontal">
|
||||
{% csrf_token %}
|
||||
<p>{% blocktrans %}Are you sure you want to delete the category <strong>{{ category.name }}</strong>?{% endblocktrans %}</p>
|
||||
<p>{% blocktrans trimmed with name=category.name %}
|
||||
Are you sure you want to delete the category <strong>{{ name }}</strong>?
|
||||
{% endblocktrans %}</p>
|
||||
<div class="form-group submit-group">
|
||||
<a href="{% url "control:event.items.categories" organizer=request.event.organizer.slug event=request.event.slug %}" class="btn btn-default btn-cancel">
|
||||
{% trans "Cancel" %}
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Items" %}{% endblock %}
|
||||
{% block title %}{% trans "Products" %}{% endblock %}
|
||||
{% block inside %}
|
||||
<h1>{% trans "Items" %}</h1>
|
||||
<h1>{% trans "Products" %}</h1>
|
||||
<p>
|
||||
<a href="{% url "control:event.items.add" organizer=request.event.organizer.slug event=request.event.slug %}" class="btn btn-default"><i class="fa fa-plus"></i> {% trans "Create new item" %}</a>
|
||||
<a href="{% url "control:event.items.add" organizer=request.event.organizer.slug event=request.event.slug %}"
|
||||
class="btn btn-default"><i class="fa fa-plus"></i> {% trans "Create new product" %}</a>
|
||||
</p>
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Item name" %}</th>
|
||||
<th>{% trans "Product name" %}</th>
|
||||
<th>{% trans "Category" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Item properties" %}{% endblock %}
|
||||
{% block title %}{% trans "Product properties" %}{% endblock %}
|
||||
{% block inside %}
|
||||
<h1>{% trans "Item properties" %}</h1>
|
||||
<h1>{% trans "Product properties" %}</h1>
|
||||
{% if "updated" in request.GET %}
|
||||
<div class="alert alert-success">
|
||||
{% trans "Your changes have been saved." %}
|
||||
@@ -22,7 +22,7 @@
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Item properties" %}</th>
|
||||
<th>{% trans "Product properties" %}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% load formset_tags %}
|
||||
{% block title %}{% trans "Item property" %}{% endblock %}
|
||||
{% block title %}{% trans "Product property" %}{% endblock %}
|
||||
{% block inside %}
|
||||
<h1>{% trans "Item property" %}</h1>
|
||||
<h1>{% trans "Product property" %}</h1>
|
||||
<form action="" method="post" class="form-horizontal">
|
||||
{% csrf_token %}
|
||||
{% if "success" in request.GET %}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{% extends "pretixcontrol/items/base.html" %}
|
||||
{% load i18n %}
|
||||
{% load bootstrap3 %}
|
||||
{% block title %}{% trans "Delete item property" %}{% endblock %}
|
||||
{% block title %}{% trans "Delete product property" %}{% endblock %}
|
||||
{% block inside %}
|
||||
<h1>{% trans "Delete item property" %}</h1>
|
||||
<h1>{% trans "Delete product property" %}</h1>
|
||||
{% if not possible %}
|
||||
<p>{% blocktrans %}You can not delete the property <strong>{{ property }}</strong> as long as the following items use it:{% endblocktrans %}</p>
|
||||
<p>{% blocktrans %}You can not delete the property <strong>{{ property }}</strong> as long as the following products use it:{% endblocktrans %}</p>
|
||||
<ul>
|
||||
{% for item in dependent %}
|
||||
<li><a href="{% url "control:event.item" organizer=request.event.organizer.slug event=request.event.slug item=item.pk %}">{{ item.name }}</a></li>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
{% csrf_token %}
|
||||
<p>{% blocktrans %}Are you sure you want to the question <strong>{{ question }}</strong>?{% endblocktrans %}</p>
|
||||
{% if dependent|length > 0 %}
|
||||
<p>{% blocktrans %}All answers to the question given by the buyers of the following tickets will be <strong>lost</strong>.{% endblocktrans %}</p>
|
||||
<p>{% blocktrans %}All answers to the question given by the buyers of the following products will be <strong>lost</strong>.{% endblocktrans %}</p>
|
||||
{% for item in dependent %}
|
||||
<li><a href="{% url "control:event.item" organizer=request.event.organizer.slug event=request.event.slug item=item.pk %}">{{ item.name }}</a></li>
|
||||
{% endfor %}
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
<legend>{% trans "Items" %}</legend>
|
||||
<p>
|
||||
{% blocktrans trimmed %}
|
||||
Please select the items or item variations this quota should be applied to. If you apply two
|
||||
quotas to the same items, it will only be available if <strong>both</strong> quotas have capacity
|
||||
Please select the products or product variations this quota should be applied to. If you apply two
|
||||
quotas to the same product, it will only be available if <strong>both</strong> quotas have capacity
|
||||
left.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
{% csrf_token %}
|
||||
<p>{% blocktrans %}Are you sure you want to delete the quota <strong>{{ quota }}</strong>?{% endblocktrans %}</p>
|
||||
{% if dependent|length > 0 %}
|
||||
<p>{% blocktrans %}The following items might be no longer available for sale:{% endblocktrans %}</p>
|
||||
<p>{% blocktrans %}The following products might be no longer available for sale:{% endblocktrans %}</p>
|
||||
{% for item in dependent %}
|
||||
<li><a href="{% url "control:event.item" organizer=request.event.organizer.slug event=request.event.slug item=item.pk %}">{{ item.name }}</a></li>
|
||||
{% endfor %}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans "Quota name" %}</th>
|
||||
<th>{% trans "Items" %}</th>
|
||||
<th>{% trans "Products" %}</th>
|
||||
<th>{% trans "Total capacity" %}</th>
|
||||
<th>{% trans "Capacity left" %}</th>
|
||||
<th></th>
|
||||
|
||||
@@ -13,7 +13,7 @@ class TimeRestrictionApp(AppConfig):
|
||||
author = _("the pretix team")
|
||||
version = '1.0.0'
|
||||
description = _("This plugin adds the possibility to restrict the sale " +
|
||||
"of a given item or variation to a certain timeframe " +
|
||||
"of a given product or variation to a certain timeframe " +
|
||||
"or change its price during a certain period.")
|
||||
|
||||
def ready(self):
|
||||
|
||||
@@ -55,7 +55,7 @@ class CartActionMixin:
|
||||
messages.error(self.request, _('Please enter numbers only.'))
|
||||
return []
|
||||
if len(items) == 0:
|
||||
messages.warning(self.request, _('You did not select any items.'))
|
||||
messages.warning(self.request, _('You did not select any products.'))
|
||||
return []
|
||||
return items
|
||||
|
||||
@@ -84,13 +84,13 @@ class CartRemove(EventViewMixin, CartActionMixin, EventLoginRequiredMixin, View)
|
||||
class CartAdd(EventViewMixin, CartActionMixin, View):
|
||||
|
||||
error_messages = {
|
||||
'unavailable': _('Some of the items you selected were no longer available. '
|
||||
'unavailable': _('Some of the products you selected were no longer available. '
|
||||
'Please see below for details.'),
|
||||
'in_part': _('Some of the items you selected were no longer available in '
|
||||
'in_part': _('Some of the products you selected were no longer available in '
|
||||
'the quantity you selected. Please see below for details.'),
|
||||
'busy': _('We were not able to process your request completely as the '
|
||||
'server was too busy. Please try again.'),
|
||||
'not_for_sale': _('You selected an item which is not available for sale.'),
|
||||
'not_for_sale': _('You selected a product which is not available for sale.'),
|
||||
'max_items': _("You cannot select more than %s items per order"),
|
||||
}
|
||||
|
||||
@@ -232,6 +232,6 @@ class CartAdd(EventViewMixin, CartActionMixin, View):
|
||||
quota.release()
|
||||
|
||||
if not self.msg_some_unavailable:
|
||||
messages.success(self.request, _('The items have been successfully added to your cart.'))
|
||||
messages.success(self.request, _('The products have been successfully added to your cart.'))
|
||||
|
||||
return redirect(self.get_success_url())
|
||||
|
||||
@@ -254,9 +254,9 @@ class OrderConfirm(EventViewMixin, CartDisplayMixin, EventLoginRequiredMixin, Ch
|
||||
template_name = "pretixpresale/event/checkout_confirm.html"
|
||||
|
||||
error_messages = {
|
||||
'unavailable': _('Some of the items you selected were no longer available. '
|
||||
'unavailable': _('Some of the products you selected were no longer available. '
|
||||
'Please see below for details.'),
|
||||
'in_part': _('Some of the items you selected were no longer available in '
|
||||
'in_part': _('Some of the products you selected were no longer available in '
|
||||
'the quantity you selected. Please see below for details.'),
|
||||
'price_changed': _('The price of some of the items in your cart has changed in the '
|
||||
'meantime. Please see below for details.'),
|
||||
|
||||
@@ -36,7 +36,7 @@ class EventsTest(BrowserTest):
|
||||
|
||||
def test_event_list(self):
|
||||
self.driver.get('%s%s' % (self.live_server_url, '/control/events/'))
|
||||
tabletext = self.driver.find_element_by_css_selector(".container .table").text
|
||||
tabletext = self.driver.find_element_by_css_selector("#page-wrapper .table").text
|
||||
self.assertIn("30C3", tabletext)
|
||||
self.assertNotIn("31C3", tabletext)
|
||||
self.assertNotIn("MRMCD14", tabletext)
|
||||
|
||||
@@ -40,7 +40,7 @@ class CategoriesTest(ItemFormTest):
|
||||
self.driver.find_element_by_name("name").send_keys('Entry tickets')
|
||||
self.driver.find_element_by_class_name("btn-save").click()
|
||||
self.driver.find_element_by_class_name("alert-success")
|
||||
self.assertIn("Entry tickets", self.driver.find_element_by_css_selector(".container table").text)
|
||||
self.assertIn("Entry tickets", self.driver.find_element_by_css_selector("#page-wrapper table").text)
|
||||
|
||||
def test_update(self):
|
||||
c = ItemCategory.objects.create(event=self.event1, name="Entry tickets")
|
||||
@@ -51,8 +51,8 @@ class CategoriesTest(ItemFormTest):
|
||||
self.driver.find_element_by_name("name").send_keys('T-Shirts')
|
||||
self.scroll_and_click(self.driver.find_element_by_class_name("btn-save"))
|
||||
self.driver.find_element_by_class_name("alert-success")
|
||||
self.assertIn("T-Shirts", self.driver.find_element_by_css_selector(".container table").text)
|
||||
self.assertNotIn("Entry tickets", self.driver.find_element_by_css_selector(".container table").text)
|
||||
self.assertIn("T-Shirts", self.driver.find_element_by_css_selector("#page-wrapper table").text)
|
||||
self.assertNotIn("Entry tickets", self.driver.find_element_by_css_selector("#page-wrapper table").text)
|
||||
|
||||
@unittest.skipIf('TRAVIS' in os.environ, 'See docstring for details.')
|
||||
def test_sort(self):
|
||||
@@ -95,7 +95,7 @@ class CategoriesTest(ItemFormTest):
|
||||
))
|
||||
self.driver.find_element_by_class_name("btn-danger").click()
|
||||
self.driver.find_element_by_class_name("alert-success")
|
||||
self.assertNotIn("Entry tickets", self.driver.find_element_by_css_selector(".container table").text)
|
||||
self.assertNotIn("Entry tickets", self.driver.find_element_by_css_selector("#page-wrapper table").text)
|
||||
|
||||
|
||||
class PropertiesTest(ItemFormTest):
|
||||
@@ -109,7 +109,7 @@ class PropertiesTest(ItemFormTest):
|
||||
self.driver.find_element_by_name("values-1-value").send_keys('M')
|
||||
self.scroll_and_click(self.driver.find_element_by_class_name("btn-save"))
|
||||
self.driver.find_element_by_class_name("alert-success")
|
||||
self.assertIn("Size", self.driver.find_element_by_css_selector(".container table").text)
|
||||
self.assertIn("Size", self.driver.find_element_by_css_selector("#page-wrapper table").text)
|
||||
self.driver.find_element_by_partial_link_text("Size").click()
|
||||
self.assertEqual("S", self.driver.find_element_by_name("values-0-value").get_attribute("value"))
|
||||
self.assertEqual("M", self.driver.find_element_by_name("values-1-value").get_attribute("value"))
|
||||
@@ -142,7 +142,7 @@ class PropertiesTest(ItemFormTest):
|
||||
))
|
||||
self.driver.find_element_by_class_name("btn-danger").click()
|
||||
self.driver.find_element_by_class_name("alert-success")
|
||||
self.assertNotIn("Size", self.driver.find_element_by_css_selector(".container table").text)
|
||||
self.assertNotIn("Size", self.driver.find_element_by_css_selector("#page-wrapper table").text)
|
||||
|
||||
|
||||
class QuestionsTest(ItemFormTest):
|
||||
@@ -155,7 +155,7 @@ class QuestionsTest(ItemFormTest):
|
||||
Select(self.driver.find_element_by_name("type")).select_by_value('N')
|
||||
self.driver.find_element_by_class_name("btn-save").click()
|
||||
self.driver.find_element_by_class_name("alert-success")
|
||||
self.assertIn("shoe size", self.driver.find_element_by_css_selector(".container table").text)
|
||||
self.assertIn("shoe size", self.driver.find_element_by_css_selector("#page-wrapper table").text)
|
||||
|
||||
def test_update(self):
|
||||
c = Question.objects.create(event=self.event1, question="What is your shoe size?", type="N", required=True)
|
||||
@@ -166,8 +166,8 @@ class QuestionsTest(ItemFormTest):
|
||||
self.driver.find_element_by_name("question").send_keys('How old are you?')
|
||||
self.scroll_and_click(self.driver.find_element_by_class_name("btn-save"))
|
||||
self.driver.find_element_by_class_name("alert-success")
|
||||
self.assertIn("How old", self.driver.find_element_by_css_selector(".container table").text)
|
||||
self.assertNotIn("shoe size", self.driver.find_element_by_css_selector(".container table").text)
|
||||
self.assertIn("How old", self.driver.find_element_by_css_selector("#page-wrapper table").text)
|
||||
self.assertNotIn("shoe size", self.driver.find_element_by_css_selector("#page-wrapper table").text)
|
||||
c = Question.objects.current.get(identity=c.identity)
|
||||
self.assertTrue(c.required)
|
||||
|
||||
@@ -178,7 +178,7 @@ class QuestionsTest(ItemFormTest):
|
||||
))
|
||||
self.driver.find_element_by_class_name("btn-danger").click()
|
||||
self.driver.find_element_by_class_name("alert-success")
|
||||
self.assertNotIn("shoe size", self.driver.find_element_by_css_selector(".container table").text)
|
||||
self.assertNotIn("shoe size", self.driver.find_element_by_css_selector("#page-wrapper table").text)
|
||||
|
||||
|
||||
class QuotaTest(ItemFormTest):
|
||||
@@ -191,7 +191,7 @@ class QuotaTest(ItemFormTest):
|
||||
self.driver.find_element_by_name("size").send_keys('500')
|
||||
self.driver.find_element_by_class_name("btn-save").click()
|
||||
self.driver.find_element_by_class_name("alert-success")
|
||||
self.assertIn("Full house", self.driver.find_element_by_css_selector(".container table").text)
|
||||
self.assertIn("Full house", self.driver.find_element_by_css_selector("#page-wrapper table").text)
|
||||
|
||||
def test_update(self):
|
||||
c = Quota.objects.create(event=self.event1, name="Full house", size=500)
|
||||
@@ -206,16 +206,17 @@ class QuotaTest(ItemFormTest):
|
||||
))
|
||||
self.driver.find_element_by_name("size").clear()
|
||||
self.driver.find_element_by_name("size").send_keys('350')
|
||||
self.scroll_and_click(self.driver.find_element_by_css_selector('.panel-group .panel:nth-child(1) .panel-title a'))
|
||||
time.sleep(1)
|
||||
# self.scroll_and_click(self.driver.find_element_by_css_selector('.panel-group .panel:nth-child(1)
|
||||
# .panel-title a'))
|
||||
# time.sleep(1)
|
||||
self.scroll_and_click(self.driver.find_element_by_name("item_%s" % item1.identity))
|
||||
self.driver.find_element_by_css_selector('.panel-group .panel:nth-child(2) .panel-title a').click()
|
||||
time.sleep(1)
|
||||
# self.driver.find_element_by_css_selector('.panel-group .panel:nth-child(2) .panel-title a').click()
|
||||
# time.sleep(1)
|
||||
self.scroll_and_click(self.driver.find_elements_by_css_selector("input[name=item_%s]" % item2.identity)[1])
|
||||
self.scroll_and_click(self.driver.find_element_by_class_name("btn-save"))
|
||||
self.driver.find_element_by_class_name("alert-success")
|
||||
self.assertIn("350", self.driver.find_element_by_css_selector(".container table").text)
|
||||
self.assertNotIn("500", self.driver.find_element_by_css_selector(".container table").text)
|
||||
self.assertIn("350", self.driver.find_element_by_css_selector("#page-wrapper table").text)
|
||||
self.assertNotIn("500", self.driver.find_element_by_css_selector("#page-wrapper table").text)
|
||||
|
||||
def test_delete(self):
|
||||
c = Quota.objects.create(event=self.event1, name="Full house", size=500)
|
||||
@@ -224,4 +225,4 @@ class QuotaTest(ItemFormTest):
|
||||
))
|
||||
self.driver.find_element_by_class_name("btn-danger").click()
|
||||
self.driver.find_element_by_class_name("alert-success")
|
||||
self.assertNotIn("Full house", self.driver.find_element_by_css_selector(".container table").text)
|
||||
self.assertNotIn("Full house", self.driver.find_element_by_css_selector("#page-wrapper table").text)
|
||||
|
||||
@@ -193,7 +193,7 @@ class CartTest(CartTestMixin, TestCase):
|
||||
self.assertRedirects(response, '/%s/%s/' % (self.orga.slug, self.event.slug),
|
||||
target_status_code=200)
|
||||
doc = BeautifulSoup(response.rendered_content)
|
||||
self.assertIn('did not select any items', doc.select('.alert-warning')[0].text)
|
||||
self.assertIn('did not select any products', doc.select('.alert-warning')[0].text)
|
||||
self.assertFalse(CartPosition.objects.filter(user=self.user, event=self.event).exists())
|
||||
|
||||
def test_wrong_event(self):
|
||||
|
||||
Reference in New Issue
Block a user