Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
fix testcase crash #12 and fix language url prefix behavior #9
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmcorpsvit committed Nov 7, 2017
1 parent e9ece1d commit 42caea4
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 124 deletions.
Binary file modified db.sqlite
Binary file not shown.
1 change: 1 addition & 0 deletions runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-3.6.0
24 changes: 13 additions & 11 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ def location(x):
SQL_DEBUG = DEBUG

ALLOWED_HOSTS = [
'latest.oscarcommerce.com',
'master.oscarcommerce.com',
# 'latest.oscarcommerce.com',
# 'master.oscarcommerce.com',
'localhost',
'127.0.0.1',
# '192.168.1.*',
]

# This is needed for the hosted version of the sandbox
Expand Down Expand Up @@ -58,7 +59,8 @@ def location(x):
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
USE_TZ = False
USE_TZ = True
TIME_ZONE = 'Europe/Kiev'
# TIME_ZONE = 'Europe/London'

TEST_RUNNER = 'django.test.runner.DiscoverRunner'
Expand All @@ -81,7 +83,6 @@ def location(x):
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# USE_I18N = False

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
Expand Down Expand Up @@ -156,9 +157,9 @@ def location(x):
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',

# Allow languages to be selected
'django.middleware.locale.LocaleMiddleware',
'django.middleware.http.ConditionalGetMiddleware',
'django.middleware.common.CommonMiddleware',
# 'django.middleware.locale.LocaleMiddleware',
# 'django.middleware.http.ConditionalGetMiddleware',
# 'django.middleware.common.CommonMiddleware',

# Ensure a valid basket is added to the request instance for every request
'oscar.apps.basket.middleware.BasketMiddleware',
Expand Down Expand Up @@ -263,7 +264,11 @@ def location(x):

# Debug toolbar + extensions
'debug_toolbar',
# ====================
# add my apps
# ====================
'apps.gateway', # For allowing dashboard access

'widget_tweaks',
] + oscar.get_core_apps()

Expand Down Expand Up @@ -292,7 +297,6 @@ def location(x):
# ====================
# Messages contrib app
# ====================

from django.contrib.messages import constants as messages
MESSAGE_TAGS = {
messages.ERROR: 'danger'
Expand All @@ -317,18 +321,16 @@ def location(x):
# =============
# Debug Toolbar
# =============

INTERNAL_IPS = ['127.0.0.1', '::1']

# ==============
# Oscar settings
# ==============

from oscar.defaults import *


# Meta
# ====

OSCAR_SHOP_TAGLINE = 'Sandbox'

OSCAR_RECENTLY_VIEWED_PRODUCTS = 20
Expand Down
66 changes: 0 additions & 66 deletions tests/test_checkout_forms.py_

This file was deleted.

8 changes: 4 additions & 4 deletions tests/test_settings.py → tests/test_core.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from django.test import TestCase
# from sophoshop.settings import *
from django.utils.translation import ugettext_lazy as _

# DATABASES['default'] = DB.DATABASES['default']


class TestSettings(TestCase):
def setUp(self):
pass

def test_ukraine_language(self):
print(_("Body Text"))
self.assertTrue(_("Body Text") == "Текст Тіла", 'Ukraine language fix error')
pass
39 changes: 0 additions & 39 deletions tests/test_shipping_methods.py_

This file was deleted.

17 changes: 13 additions & 4 deletions urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,37 @@
admin.autodiscover()

urlpatterns = [
# Include admin as convenience. It's unsupported and only included
# for developers.
# ********************************
url(r'^', application.urls),

# Include admin as convenience. It's unsupported and only included for developers.
url(r'^admin/', include(admin.site.urls)),

# i18n URLS need to live outside of i18n_patterns scope of Oscar
url(r'^i18n/', include(django.conf.urls.i18n)),
# url(r'^i18n/', include(django.conf.urls.i18n)),

# include a basic sitemap
url(r'^sitemap\.xml$', views.index,
{'sitemaps': base_sitemaps}),
url(r'^sitemap-(?P<section>.+)\.xml$', views.sitemap,
{'sitemaps': base_sitemaps},
name='django.contrib.sitemaps.views.sitemap')
name='django.contrib.sitemaps.views.sitemap'),

# ********************************
# Custom functionality to allow dashboard users to be created
url(r'gateway/', include(gateway_urls)),
]

# Prefix Oscar URLs with language codes
"""
urlpatterns += i18n_patterns(
# Custom functionality to allow dashboard users to be created
url(r'gateway/', include(gateway_urls)),
# Oscar's normal URLs
url(r'^', application.urls),
)
"""


if settings.DEBUG:
import debug_toolbar
Expand Down

0 comments on commit 42caea4

Please sign in to comment.