Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Rename shop to saleor, Python 3 compatibility

Patryk Zawadzkib7d40bc4190f
diff --git a/.travis.yml b/.travis.yml
index 40d66a55f8..c12a1fece9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,5 +7,5 @@ python:
install:
- python setup.py install
script:
- - export DJANGO_SETTINGS_MODULE=shop.test_settings
+ - export DJANGO_SETTINGS_MODULE=saleor.test_settings
- python setup.py test
diff --git a/manage.py b/manage.py
index 32f2695e25..de46e4e0a3 100755
--- a/manage.py
+++ b/manage.py
@@ -3,7 +3,7 @@ import os
import sys
if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shop.settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "saleor.settings")
from django.core.management import execute_from_command_line
diff --git a/shop/__init__.py b/saleor/__init__.py
similarity index 70%
rename from shop/__init__.py
rename to saleor/__init__.py
index 33f8e739b5..4fe58bb95c 100644
--- a/shop/__init__.py
+++ b/saleor/__init__.py
@@ -6,5 +6,5 @@ def manage():
import sys
from django.core.management import execute_from_command_line
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shop.settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "saleor.settings")
execute_from_command_line(sys.argv)
diff --git a/shop/cart/__init__.py b/saleor/cart/__init__.py
similarity index 100%
rename from shop/cart/__init__.py
rename to saleor/cart/__init__.py
diff --git a/shop/cart/forms.py b/saleor/cart/forms.py
similarity index 97%
rename from shop/cart/forms.py
rename to saleor/cart/forms.py
index 0844fbf47c..384ecc7495 100644
--- a/shop/cart/forms.py
+++ b/saleor/cart/forms.py
@@ -1,7 +1,7 @@
from decimal import Decimal
from django import forms
-from django.forms.formsets import BaseFormSet
+from django.forms.formsets import BaseFormSet, DEFAULT_MAX_NUM
from django.utils.translation import pgettext, ugettext
from satchless.item import InsufficientStock
@@ -83,7 +83,7 @@ class ReplaceCartLineFormSet(BaseFormSet):
can_order = False
extra = 0
form = ReplaceCartLineForm
- max_num = None
+ max_num = DEFAULT_MAX_NUM
def __init__(self, *args, **kwargs):
self.cart = kwargs.pop('cart')
diff --git a/shop/cart/middleware.py b/saleor/cart/middleware.py
similarity index 100%
rename from shop/cart/middleware.py
rename to saleor/cart/middleware.py
diff --git a/shop/cart/models.py b/saleor/cart/models.py
similarity index 100%
rename from shop/cart/models.py
rename to saleor/cart/models.py
diff --git a/shop/cart/templates/cart/index.html b/saleor/cart/templates/cart/index.html
similarity index 100%
rename from shop/cart/templates/cart/index.html
rename to saleor/cart/templates/cart/index.html
diff --git a/shop/cart/tests.py b/saleor/cart/tests.py
similarity index 100%
rename from shop/cart/tests.py
rename to saleor/cart/tests.py
diff --git a/shop/cart/urls.py b/saleor/cart/urls.py
similarity index 100%
rename from shop/cart/urls.py
rename to saleor/cart/urls.py
diff --git a/shop/cart/views.py b/saleor/cart/views.py
similarity index 100%
rename from shop/cart/views.py
rename to saleor/cart/views.py
diff --git a/shop/checkout/__init__.py b/saleor/checkout/__init__.py
similarity index 100%
rename from shop/checkout/__init__.py
rename to saleor/checkout/__init__.py
diff --git a/shop/checkout/forms.py b/saleor/checkout/forms.py
similarity index 100%
rename from shop/checkout/forms.py
rename to saleor/checkout/forms.py
diff --git a/shop/checkout/models.py b/saleor/checkout/models.py
similarity index 100%
rename from shop/checkout/models.py
rename to saleor/checkout/models.py
diff --git a/shop/checkout/steps.py b/saleor/checkout/steps.py
similarity index 100%
rename from shop/checkout/steps.py
rename to saleor/checkout/steps.py
diff --git a/shop/checkout/templates/checkout/address.html b/saleor/checkout/templates/checkout/address.html
similarity index 100%
rename from shop/checkout/templates/checkout/address.html
rename to saleor/checkout/templates/checkout/address.html
diff --git a/shop/checkout/templates/checkout/billing.html b/saleor/checkout/templates/checkout/billing.html
similarity index 100%
rename from shop/checkout/templates/checkout/billing.html
rename to saleor/checkout/templates/checkout/billing.html
diff --git a/shop/checkout/templates/checkout/details.html b/saleor/checkout/templates/checkout/details.html
similarity index 100%
rename from shop/checkout/templates/checkout/details.html
rename to saleor/checkout/templates/checkout/details.html
diff --git a/shop/checkout/templates/checkout/digitaldelivery.html b/saleor/checkout/templates/checkout/digitaldelivery.html
similarity index 100%
rename from shop/checkout/templates/checkout/digitaldelivery.html
rename to saleor/checkout/templates/checkout/digitaldelivery.html
diff --git a/shop/checkout/templates/checkout/shipping.html b/saleor/checkout/templates/checkout/shipping.html
similarity index 100%
rename from shop/checkout/templates/checkout/shipping.html
rename to saleor/checkout/templates/checkout/shipping.html
diff --git a/shop/checkout/templates/checkout/summary.html b/saleor/checkout/templates/checkout/summary.html
similarity index 100%
rename from shop/checkout/templates/checkout/summary.html
rename to saleor/checkout/templates/checkout/summary.html
diff --git a/shop/checkout/tests.py b/saleor/checkout/tests.py
similarity index 100%
rename from shop/checkout/tests.py
rename to saleor/checkout/tests.py
diff --git a/shop/checkout/urls.py b/saleor/checkout/urls.py
similarity index 100%
rename from shop/checkout/urls.py
rename to saleor/checkout/urls.py
diff --git a/shop/checkout/views.py b/saleor/checkout/views.py
similarity index 100%
rename from shop/checkout/views.py
rename to saleor/checkout/views.py
diff --git a/shop/communication/__init__.py b/saleor/communication/__init__.py
similarity index 100%
rename from shop/communication/__init__.py
rename to saleor/communication/__init__.py
diff --git a/shop/communication/mail.py b/saleor/communication/mail.py
similarity index 100%
rename from shop/communication/mail.py
rename to saleor/communication/mail.py
diff --git a/shop/communication/tests.py b/saleor/communication/tests.py
similarity index 89%
rename from shop/communication/tests.py
rename to saleor/communication/tests.py
index c1f6b32c24..2914604114 100644
--- a/shop/communication/tests.py
+++ b/saleor/communication/tests.py
@@ -9,11 +9,11 @@ from .mail import SUBJECT, TEXT, HTML, send_email, render_blocks
class SendEmailTestCase(TestCase):
def setUp(self):
- patcher = patch('shop.communication.mail.settings')
+ patcher = patch('saleor.communication.mail.settings')
self.settings_mock = patcher.start()
- patcher = patch('shop.communication.mail.render_blocks')
+ patcher = patch('saleor.communication.mail.render_blocks')
self.render_mock = patcher.start()
- patcher = patch('shop.communication.mail.EmailMultiAlternatives')
+ patcher = patch('saleor.communication.mail.EmailMultiAlternatives')
self.email_mock = patcher.start()
self.settings_mock.DEFAULT_FROM_EMAIL = sentinel.from_email
@@ -54,8 +54,8 @@ class SendEmailTestCase(TestCase):
class RenderBlocksTestCase(TestCase):
- @patch('shop.communication.mail.get_template')
- @patch('shop.communication.mail.Context')
+ @patch('saleor.communication.mail.get_template')
+ @patch('saleor.communication.mail.Context')
def test_block_rendering(self, context_mock, get_template_mock):
"""Template blocks are rendered with proper context"""
html_block = Mock(spec=BlockNode)
diff --git a/shop/core/__init__.py b/saleor/core/__init__.py
similarity index 100%
rename from shop/core/__init__.py
rename to saleor/core/__init__.py
diff --git a/shop/core/context_processors.py b/saleor/core/context_processors.py
similarity index 100%
rename from shop/core/context_processors.py
rename to saleor/core/context_processors.py
diff --git a/shop/core/countries.py b/saleor/core/countries.py
similarity index 100%
rename from shop/core/countries.py
rename to saleor/core/countries.py
diff --git a/shop/core/middleware.py b/saleor/core/middleware.py
similarity index 100%
rename from shop/core/middleware.py
rename to saleor/core/middleware.py
diff --git a/shop/core/models.py b/saleor/core/models.py
similarity index 100%
rename from shop/core/models.py
rename to saleor/core/models.py
diff --git a/shop/core/templates/bootstrap/_field_horizontal.html b/saleor/core/templates/bootstrap/_field_horizontal.html
similarity index 100%
rename from shop/core/templates/bootstrap/_field_horizontal.html
rename to saleor/core/templates/bootstrap/_field_horizontal.html
diff --git a/shop/core/templates/bootstrap/_field_vertical.html b/saleor/core/templates/bootstrap/_field_vertical.html
similarity index 100%
rename from shop/core/templates/bootstrap/_field_vertical.html
rename to saleor/core/templates/bootstrap/_field_vertical.html
diff --git a/shop/core/templates/bootstrap/_non_field_errors.html b/saleor/core/templates/bootstrap/_non_field_errors.html
similarity index 100%
rename from shop/core/templates/bootstrap/_non_field_errors.html
rename to saleor/core/templates/bootstrap/_non_field_errors.html
diff --git a/shop/core/templatetags/__init__.py b/saleor/core/templatetags/__init__.py
similarity index 100%
rename from shop/core/templatetags/__init__.py
rename to saleor/core/templatetags/__init__.py
diff --git a/shop/core/templatetags/bootstrap.py b/saleor/core/templatetags/bootstrap.py
similarity index 100%
rename from shop/core/templatetags/bootstrap.py
rename to saleor/core/templatetags/bootstrap.py
diff --git a/shop/core/templatetags/shop.py b/saleor/core/templatetags/shop.py
similarity index 50%
rename from shop/core/templatetags/shop.py
rename to saleor/core/templatetags/shop.py
index d9d5a7402f..f531870389 100644
--- a/shop/core/templatetags/shop.py
+++ b/saleor/core/templatetags/shop.py
@@ -1,4 +1,7 @@
-from itertools import izip_longest
+try:
+ from itertools import zip_longest
+except ImportError:
+ from itertools import izip_longest as zip_longest
from django.template import Library
@@ -9,4 +12,4 @@ register = Library()
def slice(items, group_size=1):
args = [iter(items)] * group_size
return (filter(None, group)
- for group in izip_longest(*args, fillvalue=None))
+ for group in zip_longest(*args, fillvalue=None))
diff --git a/shop/core/tests.py b/saleor/core/tests.py
similarity index 100%
rename from shop/core/tests.py
rename to saleor/core/tests.py
diff --git a/shop/core/urls.py b/saleor/core/urls.py
similarity index 100%
rename from shop/core/urls.py
rename to saleor/core/urls.py
diff --git a/shop/core/utils/__init__.py b/saleor/core/utils/__init__.py
similarity index 100%
rename from shop/core/utils/__init__.py
rename to saleor/core/utils/__init__.py
diff --git a/shop/core/utils/models.py b/saleor/core/utils/models.py
similarity index 100%
rename from shop/core/utils/models.py
rename to saleor/core/utils/models.py
diff --git a/shop/core/views.py b/saleor/core/views.py
similarity index 100%
rename from shop/core/views.py
rename to saleor/core/views.py
diff --git a/shop/delivery/__init__.py b/saleor/delivery/__init__.py
similarity index 100%
rename from shop/delivery/__init__.py
rename to saleor/delivery/__init__.py
diff --git a/shop/order/__init__.py b/saleor/order/__init__.py
similarity index 100%
rename from shop/order/__init__.py
rename to saleor/order/__init__.py
diff --git a/shop/order/admin.py b/saleor/order/admin.py
similarity index 100%
rename from shop/order/admin.py
rename to saleor/order/admin.py
diff --git a/shop/order/models.py b/saleor/order/models.py
similarity index 98%
rename from shop/order/models.py
rename to saleor/order/models.py
index e1e63f54d2..441856d66b 100644
--- a/shop/order/models.py
+++ b/saleor/order/models.py
@@ -5,6 +5,7 @@ from decimal import Decimal
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
+from django.utils.encoding import smart_text
from django.utils.translation import pgettext_lazy
from django_prices.models import PriceField
from prices import Price
@@ -53,7 +54,7 @@ class Order(models.Model, ItemSet):
def save(self, *args, **kwargs):
if not self.token:
- for _i in xrange(100):
+ for _i in range(100):
token = str(uuid4())
if not type(self).objects.filter(token=token).exists():
self.token = token
@@ -141,7 +142,7 @@ class DeliveryGroup(Subtyped, ItemSet):
def add_items_from_partition(self, partition):
for item_line in partition:
- product_name = unicode(item_line.product)
+ product_name = smart_text(item_line.product)
price = item_line.get_price_per_item()
self.items.create(
product=item_line.product,
diff --git a/shop/order/static/js/order_details.js b/saleor/order/static/js/order_details.js
similarity index 100%
rename from shop/order/static/js/order_details.js
rename to saleor/order/static/js/order_details.js
diff --git a/shop/order/templates/order/details.html b/saleor/order/templates/order/details.html
similarity index 100%
rename from shop/order/templates/order/details.html
rename to saleor/order/templates/order/details.html
diff --git a/shop/order/templates/order/emails/confirm_email.txt b/saleor/order/templates/order/emails/confirm_email.txt
similarity index 100%
rename from shop/order/templates/order/emails/confirm_email.txt
rename to saleor/order/templates/order/emails/confirm_email.txt
diff --git a/shop/order/templates/order/success.html b/saleor/order/templates/order/success.html
similarity index 100%
rename from shop/order/templates/order/success.html
rename to saleor/order/templates/order/success.html
diff --git a/shop/order/tests.py b/saleor/order/tests.py
similarity index 100%
rename from shop/order/tests.py
rename to saleor/order/tests.py
diff --git a/shop/order/urls.py b/saleor/order/urls.py
similarity index 100%
rename from shop/order/urls.py
rename to saleor/order/urls.py
diff --git a/shop/order/views.py b/saleor/order/views.py
similarity index 100%
rename from shop/order/views.py
rename to saleor/order/views.py
diff --git a/shop/payment/__init__.py b/saleor/payment/__init__.py
similarity index 100%
rename from shop/payment/__init__.py
rename to saleor/payment/__init__.py
diff --git a/shop/payment/forms.py b/saleor/payment/forms.py
similarity index 100%
rename from shop/payment/forms.py
rename to saleor/payment/forms.py
diff --git a/shop/payment/models.py b/saleor/payment/models.py
similarity index 100%
rename from shop/payment/models.py
rename to saleor/payment/models.py
diff --git a/shop/payment/templates/payment/default.html b/saleor/payment/templates/payment/default.html
similarity index 100%
rename from shop/payment/templates/payment/default.html
rename to saleor/payment/templates/payment/default.html
diff --git a/shop/payment/templates/payment/details.html b/saleor/payment/templates/payment/details.html
similarity index 100%
rename from shop/payment/templates/payment/details.html
rename to saleor/payment/templates/payment/details.html
diff --git a/shop/payment/templates/payment/emails/confirm_email.txt b/saleor/payment/templates/payment/emails/confirm_email.txt
similarity index 100%
rename from shop/payment/templates/payment/emails/confirm_email.txt
rename to saleor/payment/templates/payment/emails/confirm_email.txt
diff --git a/shop/payment/templates/payment/index.html b/saleor/payment/templates/payment/index.html
similarity index 100%
rename from shop/payment/templates/payment/index.html
rename to saleor/payment/templates/payment/index.html
diff --git a/shop/payment/templates/payment/paypal-card.html b/saleor/payment/templates/payment/paypal-card.html
similarity index 100%
rename from shop/payment/templates/payment/paypal-card.html
rename to saleor/payment/templates/payment/paypal-card.html
diff --git a/shop/payment/urls.py b/saleor/payment/urls.py
similarity index 100%
rename from shop/payment/urls.py
rename to saleor/payment/urls.py
diff --git a/shop/payment/views.py b/saleor/payment/views.py
similarity index 100%
rename from shop/payment/views.py
rename to saleor/payment/views.py
diff --git a/shop/product/__init__.py b/saleor/product/__init__.py
similarity index 100%
rename from shop/product/__init__.py
rename to saleor/product/__init__.py
diff --git a/shop/product/admin.py b/saleor/product/admin.py
similarity index 100%
rename from shop/product/admin.py
rename to saleor/product/admin.py
diff --git a/shop/product/forms.py b/saleor/product/forms.py
similarity index 100%
rename from shop/product/forms.py
rename to saleor/product/forms.py
diff --git a/shop/product/models.py b/saleor/product/models.py
similarity index 100%
rename from shop/product/models.py
rename to saleor/product/models.py
diff --git a/shop/product/templates/category/_list.html b/saleor/product/templates/category/_list.html
similarity index 100%
rename from shop/product/templates/category/_list.html
rename to saleor/product/templates/category/_list.html
diff --git a/shop/product/templates/category/index.html b/saleor/product/templates/category/index.html
similarity index 100%
rename from shop/product/templates/category/index.html
rename to saleor/product/templates/category/index.html
diff --git a/shop/product/templates/product/details.html b/saleor/product/templates/product/details.html
similarity index 100%
rename from shop/product/templates/product/details.html
rename to saleor/product/templates/product/details.html
diff --git a/shop/product/templatetags/__init__.py b/saleor/product/templatetags/__init__.py
similarity index 100%
rename from shop/product/templatetags/__init__.py
rename to saleor/product/templatetags/__init__.py
diff --git a/shop/product/templatetags/category.py b/saleor/product/templatetags/category.py
similarity index 100%
rename from shop/product/templatetags/category.py
rename to saleor/product/templatetags/category.py
diff --git a/shop/product/templatetags/discount.py b/saleor/product/templatetags/discount.py
similarity index 99%
rename from shop/product/templatetags/discount.py
rename to saleor/product/templatetags/discount.py
index 77db963357..13f5ffd76c 100644
--- a/shop/product/templatetags/discount.py
+++ b/saleor/product/templatetags/discount.py
@@ -7,6 +7,7 @@ register = template.Library()
def undiscounted_price(item):
return item.get_price(discounted=False)
+
@register.filter
def price_difference(price1, price2):
return price1 - price2
diff --git a/shop/product/urls.py b/saleor/product/urls.py
similarity index 100%
rename from shop/product/urls.py
rename to saleor/product/urls.py
diff --git a/shop/product/views.py b/saleor/product/views.py
similarity index 100%
rename from shop/product/views.py
rename to saleor/product/views.py
diff --git a/shop/registration/__init__.py b/saleor/registration/__init__.py
similarity index 100%
rename from shop/registration/__init__.py
rename to saleor/registration/__init__.py
diff --git a/shop/registration/backends.py b/saleor/registration/backends.py
similarity index 100%
rename from shop/registration/backends.py
rename to saleor/registration/backends.py
diff --git a/shop/registration/forms.py b/saleor/registration/forms.py
similarity index 100%
rename from shop/registration/forms.py
rename to saleor/registration/forms.py
diff --git a/shop/registration/models.py b/saleor/registration/models.py
similarity index 100%
rename from shop/registration/models.py
rename to saleor/registration/models.py
diff --git a/shop/registration/templates/registration/change_password.html b/saleor/registration/templates/registration/change_password.html
similarity index 100%
rename from shop/registration/templates/registration/change_password.html
rename to saleor/registration/templates/registration/change_password.html
diff --git a/shop/registration/templates/registration/emails/change_email.txt b/saleor/registration/templates/registration/emails/change_email.txt
similarity index 100%
rename from shop/registration/templates/registration/emails/change_email.txt
rename to saleor/registration/templates/registration/emails/change_email.txt
diff --git a/shop/registration/templates/registration/emails/confirm_email.txt b/saleor/registration/templates/registration/emails/confirm_email.txt
similarity index 100%
rename from shop/registration/templates/registration/emails/confirm_email.txt
rename to saleor/registration/templates/registration/emails/confirm_email.txt
diff --git a/shop/registration/templates/registration/invalid_token.html b/saleor/registration/templates/registration/invalid_token.html
similarity index 100%
rename from shop/registration/templates/registration/invalid_token.html
rename to saleor/registration/templates/registration/invalid_token.html
diff --git a/shop/registration/templates/registration/login.html b/saleor/registration/templates/registration/login.html
similarity index 100%
rename from shop/registration/templates/registration/login.html
rename to saleor/registration/templates/registration/login.html
diff --git a/shop/registration/templates/registration/logout.html b/saleor/registration/templates/registration/logout.html
similarity index 100%
rename from shop/registration/templates/registration/logout.html
rename to saleor/registration/templates/registration/logout.html
diff --git a/shop/registration/templates/registration/request_email_confirmation.html b/saleor/registration/templates/registration/request_email_confirmation.html
similarity index 100%
rename from shop/registration/templates/registration/request_email_confirmation.html
rename to saleor/registration/templates/registration/request_email_confirmation.html
diff --git a/shop/registration/templates/registration/set_password.html b/saleor/registration/templates/registration/set_password.html
similarity index 100%
rename from shop/registration/templates/registration/set_password.html
rename to saleor/registration/templates/registration/set_password.html
diff --git a/shop/registration/tests.py b/saleor/registration/tests.py
similarity index 94%
rename from shop/registration/tests.py
rename to saleor/registration/tests.py
index bea13718c1..462939bbcd 100644
--- a/shop/registration/tests.py
+++ b/saleor/registration/tests.py
@@ -95,8 +95,9 @@ class BaseCommunicationTestCase(TestCase):
def setUp(self):
self.parse_mock = patch(
- 'shop.registration.utils.parse_response').start()
- self.requests_mock = patch('shop.registration.utils.requests').start()
+ 'saleor.registration.utils.parse_response').start()
+ self.requests_mock = patch(
+ 'saleor.registration.utils.requests').start()
self.requests_mock.codes.ok = sentinel.ok
def tearDown(self):
@@ -194,9 +195,10 @@ class AuthorizerTestCase(TestCase):
class CallbackTestCase(TestCase):
def setUp(self):
- patcher = patch('shop.registration.forms.get_client_class_for_service')
+ patcher = patch(
+ 'saleor.registration.forms.get_client_class_for_service')
self.getter_mock = patcher.start()
- patcher = patch('shop.registration.forms.authenticate')
+ patcher = patch('saleor.registration.forms.authenticate')
self.authenticate_mock = patcher.start()
self.client_class = self.getter_mock()
@@ -209,8 +211,8 @@ class CallbackTestCase(TestCase):
data={'code': 'test_code'})
self.assertTrue(self.form.is_valid(), self.form.errors)
- @patch('shop.registration.forms.ExternalUserData')
- @patch('shop.registration.forms.User')
+ @patch('saleor.registration.forms.ExternalUserData')
+ @patch('saleor.registration.forms.User')
def test_new_user(self, user_mock, external_data_mock):
"""OAuth2 callback creates a new user with proper external data"""
user_mock.objects.get_or_create.return_value = sentinel.user, None
@@ -242,7 +244,7 @@ class CallbackTestCase(TestCase):
class EmailConfirmationTestCase(TestCase):
- @patch('shop.registration.forms.authenticate')
+ @patch('saleor.registration.forms.authenticate')
def test_password_set(self, authenticate_mock):
"""Email confirmation sets new password and logs the user"""
user = Mock()
@@ -258,7 +260,7 @@ class EmailConfirmationTestCase(TestCase):
user.set_password.assert_called_once_with('pass')
authenticate_mock.assert_called_once_with(user=user)
- @patch('shop.registration.forms.authenticate')
+ @patch('saleor.registration.forms.authenticate')
def test_password_unset(self, authenticate_mock):
"""Email confirmation unsets a password and logs the user"""
user = Mock()
@@ -277,8 +279,8 @@ class EmailConfirmationTestCase(TestCase):
class EmailChangeTestCase(TestCase):
- @patch('shop.registration.views.now')
- @patch('shop.registration.views.EmailChangeRequest.objects.get')
+ @patch('saleor.registration.views.now')
+ @patch('saleor.registration.views.EmailChangeRequest.objects.get')
def test_another_user_logged_out(self, get, now):
# user requests email change
@@ -301,8 +303,8 @@ class EmailChangeTestCase(TestCase):
self.assertFalse(request.user.is_authenticated())
token_object.delete.assert_not_called()
- @patch('shop.registration.views.now')
- @patch('shop.registration.views.EmailChangeRequest.objects.get')
+ @patch('saleor.registration.views.now')
+ @patch('saleor.registration.views.EmailChangeRequest.objects.get')
def test_user_logged_in(self, get, now):
# user requests email change
diff --git a/shop/registration/urls.py b/saleor/registration/urls.py
similarity index 100%
rename from shop/registration/urls.py
rename to saleor/registration/urls.py
diff --git a/shop/registration/utils.py b/saleor/registration/utils.py
similarity index 99%
rename from shop/registration/utils.py
rename to saleor/registration/utils.py
index f569b9ed8e..c9855b97ce 100644
--- a/shop/registration/utils.py
+++ b/saleor/registration/utils.py
@@ -14,7 +14,7 @@ import requests
GOOGLE, FACEBOOK = 'google', 'facebook'
JSON_MIME_TYPE = 'application/json'
-logger = logging.getLogger('shop.registration')
+logger = logging.getLogger('saleor.registration')
User = get_user_model()
diff --git a/shop/registration/views.py b/saleor/registration/views.py
similarity index 100%
rename from shop/registration/views.py
rename to saleor/registration/views.py
diff --git a/shop/settings.py b/saleor/settings.py
similarity index 85%
rename from shop/settings.py
rename to saleor/settings.py
index 05fbcbb0be..17f1c57697 100644
--- a/shop/settings.py
+++ b/saleor/settings.py
@@ -7,9 +7,9 @@ SITE_ID = 1
PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
-ROOT_URLCONF = 'shop.urls'
+ROOT_URLCONF = 'saleor.urls'
-WSGI_APPLICATION = 'shop.wsgi.application'
+WSGI_APPLICATION = 'saleor.wsgi.application'
ADMINS = (
# ('Your Name', '[email protected]'),
@@ -36,7 +36,7 @@ MEDIA_URL = '/media/'
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
STATIC_URL = '/static/'
STATICFILES_DIRS = [
- os.path.join(PROJECT_ROOT, 'shop', 'static')
+ os.path.join(PROJECT_ROOT, 'saleor', 'static')
]
STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
@@ -62,8 +62,8 @@ MIDDLEWARE_CLASSES = [
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
- 'shop.cart.middleware.CartMiddleware',
- 'shop.core.middleware.CheckHTML'
+ 'saleor.cart.middleware.CartMiddleware',
+ 'saleor.core.middleware.CheckHTML'
]
TEMPLATE_CONTEXT_PROCESSORS = [
@@ -75,9 +75,9 @@ TEMPLATE_CONTEXT_PROCESSORS = [
'django.core.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.request',
- 'shop.core.context_processors.googe_analytics',
- 'shop.core.context_processors.canonical_hostname',
- 'shop.core.context_processors.default_currency'
+ 'saleor.core.context_processors.googe_analytics',
+ 'saleor.core.context_processors.canonical_hostname',
+ 'saleor.core.context_processors.default_currency'
]
INSTALLED_APPS = [
@@ -99,14 +99,14 @@ INSTALLED_APPS = [
'south',
# Local apps
- 'shop.cart',
- 'shop.checkout',
- 'shop.core',
- 'shop.order',
- 'shop.payment',
- 'shop.product',
- 'shop.registration',
- 'shop.userprofile'
+ 'saleor.cart',
+ 'saleor.checkout',
+ 'saleor.core',
+ 'saleor.order',
+ 'saleor.payment',
+ 'saleor.product',
+ 'saleor.registration',
+ 'saleor.userprofile'
]
LOGGING = {
@@ -148,7 +148,7 @@ LOGGING = {
'level': 'ERROR',
'propagate': True
},
- 'shop': {
+ 'saleor': {
'handlers': ['console'],
'level': 'DEBUG',
'propagate': True
@@ -157,9 +157,9 @@ LOGGING = {
}
AUTHENTICATION_BACKENDS = (
- 'shop.registration.backends.EmailPasswordBackend',
- 'shop.registration.backends.ExternalLoginBackend',
- 'shop.registration.backends.TrivialBackend'
+ 'saleor.registration.backends.EmailPasswordBackend',
+ 'saleor.registration.backends.ExternalLoginBackend',
+ 'saleor.registration.backends.TrivialBackend'
)
AUTH_USER_MODEL = 'userprofile.User'
diff --git a/shop/static/css/bootstrap-theme.css b/saleor/static/css/bootstrap-theme.css
similarity index 100%
rename from shop/static/css/bootstrap-theme.css
rename to saleor/static/css/bootstrap-theme.css
diff --git a/shop/static/css/bootstrap-theme.min.css b/saleor/static/css/bootstrap-theme.min.css
similarity index 100%
rename from shop/static/css/bootstrap-theme.min.css
rename to saleor/static/css/bootstrap-theme.min.css
diff --git a/shop/static/css/bootstrap.css b/saleor/static/css/bootstrap.css
similarity index 100%
rename from shop/static/css/bootstrap.css
rename to saleor/static/css/bootstrap.css
diff --git a/shop/static/css/bootstrap.min.css b/saleor/static/css/bootstrap.min.css
similarity index 100%
rename from shop/static/css/bootstrap.min.css
rename to saleor/static/css/bootstrap.min.css
diff --git a/shop/static/fonts/glyphicons-halflings-regular.eot b/saleor/static/fonts/glyphicons-halflings-regular.eot
similarity index 100%
rename from shop/static/fonts/glyphicons-halflings-regular.eot
rename to saleor/static/fonts/glyphicons-halflings-regular.eot
diff --git a/shop/static/fonts/glyphicons-halflings-regular.svg b/saleor/static/fonts/glyphicons-halflings-regular.svg
similarity index 100%
rename from shop/static/fonts/glyphicons-halflings-regular.svg
rename to saleor/static/fonts/glyphicons-halflings-regular.svg
diff --git a/shop/static/fonts/glyphicons-halflings-regular.ttf b/saleor/static/fonts/glyphicons-halflings-regular.ttf
similarity index 100%
rename from shop/static/fonts/glyphicons-halflings-regular.ttf
rename to saleor/static/fonts/glyphicons-halflings-regular.ttf
diff --git a/shop/static/fonts/glyphicons-halflings-regular.woff b/saleor/static/fonts/glyphicons-halflings-regular.woff
similarity index 100%
rename from shop/static/fonts/glyphicons-halflings-regular.woff
rename to saleor/static/fonts/glyphicons-halflings-regular.woff
diff --git a/shop/static/img/glyphicons-halflings-white.png b/saleor/static/img/glyphicons-halflings-white.png
similarity index 100%
rename from shop/static/img/glyphicons-halflings-white.png
rename to saleor/static/img/glyphicons-halflings-white.png
diff --git a/shop/static/img/glyphicons-halflings.png b/saleor/static/img/glyphicons-halflings.png
similarity index 100%
rename from shop/static/img/glyphicons-halflings.png
rename to saleor/static/img/glyphicons-halflings.png
diff --git a/shop/static/js/lib/bootstrap.js b/saleor/static/js/lib/bootstrap.js
similarity index 100%
rename from shop/static/js/lib/bootstrap.js
rename to saleor/static/js/lib/bootstrap.js
diff --git a/shop/static/js/lib/bootstrap.min.js b/saleor/static/js/lib/bootstrap.min.js
similarity index 100%
rename from shop/static/js/lib/bootstrap.min.js
rename to saleor/static/js/lib/bootstrap.min.js
diff --git a/shop/static/js/lib/less.js b/saleor/static/js/lib/less.js
similarity index 100%
rename from shop/static/js/lib/less.js
rename to saleor/static/js/lib/less.js
diff --git a/shop/static/less/style.less b/saleor/static/less/style.less
similarity index 100%
rename from shop/static/less/style.less
rename to saleor/static/less/style.less
diff --git a/shop/test_settings.py b/saleor/test_settings.py
similarity index 100%
rename from shop/test_settings.py
rename to saleor/test_settings.py
diff --git a/saleor/tests.py b/saleor/tests.py
new file mode 100644
index 0000000000..77345a11b2
--- /dev/null
+++ b/saleor/tests.py
@@ -0,0 +1,18 @@
+from unittest import TestSuite, TestLoader
+
+TEST_MODULES = [
+ 'saleor.cart.tests',
+ 'saleor.checkout.tests',
+ 'saleor.communication.tests',
+ 'saleor.core.tests',
+ #'saleor.delivery.tests',
+ 'saleor.order.tests',
+ #'saleor.payment.tests',
+ #'saleor.product.tests',
+ 'saleor.registration.tests',
+ 'saleor.userprofile.tests']
+
+suite = TestSuite()
+loader = TestLoader()
+for module in TEST_MODULES:
+ suite.addTests(loader.loadTestsFromName(module))
diff --git a/shop/urls.py b/saleor/urls.py
similarity index 100%
rename from shop/urls.py
rename to saleor/urls.py
diff --git a/shop/userprofile/__init__.py b/saleor/userprofile/__init__.py
similarity index 100%
rename from shop/userprofile/__init__.py
rename to saleor/userprofile/__init__.py
diff --git a/shop/userprofile/admin.py b/saleor/userprofile/admin.py
similarity index 100%
rename from shop/userprofile/admin.py
rename to saleor/userprofile/admin.py
diff --git a/shop/userprofile/forms.py b/saleor/userprofile/forms.py
similarity index 100%
rename from shop/userprofile/forms.py
rename to saleor/userprofile/forms.py
diff --git a/shop/userprofile/management/__init__.py b/saleor/userprofile/management/__init__.py
similarity index 100%
rename from shop/userprofile/management/__init__.py
rename to saleor/userprofile/management/__init__.py
diff --git a/shop/userprofile/management/commands/__init__.py b/saleor/userprofile/management/commands/__init__.py
similarity index 100%
rename from shop/userprofile/management/commands/__init__.py
rename to saleor/userprofile/management/commands/__init__.py
diff --git a/shop/userprofile/management/commands/changepassword.py b/saleor/userprofile/management/commands/changepassword.py
similarity index 100%
rename from shop/userprofile/management/commands/changepassword.py
rename to saleor/userprofile/management/commands/changepassword.py
diff --git a/shop/userprofile/management/commands/createsuperuser.py b/saleor/userprofile/management/commands/createsuperuser.py
similarity index 100%
rename from shop/userprofile/management/commands/createsuperuser.py
rename to saleor/userprofile/management/commands/createsuperuser.py
diff --git a/shop/userprofile/models.py b/saleor/userprofile/models.py
similarity index 100%
rename from shop/userprofile/models.py
rename to saleor/userprofile/models.py
diff --git a/shop/userprofile/templates/userprofile/address-delete.html b/saleor/userprofile/templates/userprofile/address-delete.html
similarity index 100%
rename from shop/userprofile/templates/userprofile/address-delete.html
rename to saleor/userprofile/templates/userprofile/address-delete.html
diff --git a/shop/userprofile/templates/userprofile/address-edit.html b/saleor/userprofile/templates/userprofile/address-edit.html
similarity index 100%
rename from shop/userprofile/templates/userprofile/address-edit.html
rename to saleor/userprofile/templates/userprofile/address-edit.html
diff --git a/shop/userprofile/templates/userprofile/details.html b/saleor/userprofile/templates/userprofile/details.html
similarity index 100%
rename from shop/userprofile/templates/userprofile/details.html
rename to saleor/userprofile/templates/userprofile/details.html
diff --git a/shop/userprofile/templates/userprofile/orders.html b/saleor/userprofile/templates/userprofile/orders.html
similarity index 100%
rename from shop/userprofile/templates/userprofile/orders.html
rename to saleor/userprofile/templates/userprofile/orders.html
diff --git a/shop/userprofile/tests.py b/saleor/userprofile/tests.py
similarity index 100%
rename from shop/userprofile/tests.py
rename to saleor/userprofile/tests.py
diff --git a/shop/userprofile/urls.py b/saleor/userprofile/urls.py
similarity index 100%
rename from shop/userprofile/urls.py
rename to saleor/userprofile/urls.py
diff --git a/shop/userprofile/views.py b/saleor/userprofile/views.py
similarity index 100%
rename from shop/userprofile/views.py
rename to saleor/userprofile/views.py
diff --git a/shop/wsgi.py b/saleor/wsgi.py
similarity index 94%
rename from shop/wsgi.py
rename to saleor/wsgi.py
index 383d859737..69d2868f85 100644
--- a/shop/wsgi.py
+++ b/saleor/wsgi.py
@@ -15,7 +15,7 @@ framework.
"""
import os
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shop.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "saleor.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
diff --git a/setup.py b/setup.py
index 465c981d96..d1b5d614e1 100755
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
from setuptools import setup, find_packages, Command
import os
-os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'shop.settings')
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'saleor.settings')
class Command(Command):
@@ -23,18 +23,18 @@ setup(
include_package_data=True,
install_requires=[
'Django>=1.5',
- 'django-images>=0.3.2,<-0.4a0',
+ 'django-images>=0.3.2.1,<-0.4a0',
'django-mptt>=0.5',
- 'django-payments>=0.3.4.1,<0.4a0',
- 'django-prices>=0.2.5,<0.3a0',
+ 'django-payments>=0.3.4.3,<0.4a0',
+ 'django-prices>=0.2.6,<0.3a0',
'prices>=0.4.2,<0.5a0',
'satchless>=1.0.4,<1.1a0',
'South>=0.7.6',
'requests>=1.2.0',
'unidecode'],
entry_points={
- 'console_scripts': ['saleor = shop:manage']},
+ 'console_scripts': ['saleor = saleor:manage']},
tests_require=[
'mock==1.0.1',
'purl>=0.4.1'],
- test_suite='shop.tests.suite')
+ test_suite='saleor.tests.suite')
diff --git a/shop/tests.py b/shop/tests.py
deleted file mode 100644
index bd71fabef5..0000000000
--- a/shop/tests.py
+++ /dev/null
@@ -1,18 +0,0 @@
-from unittest import TestSuite, TestLoader
-
-TEST_MODULES = [
- 'shop.cart.tests',
- 'shop.checkout.tests',
- 'shop.communication.tests',
- 'shop.core.tests',
- #'shop.delivery.tests',
- 'shop.order.tests',
- #'shop.payment.tests',
- #'shop.product.tests',
- 'shop.registration.tests',
- 'shop.userprofile.tests']
-
-suite = TestSuite()
-loader = TestLoader()
-for module in TEST_MODULES:
- suite.addTests(loader.loadTestsFromName(module))