Skip to content

Commit

Permalink
Resolve test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
costas-basdekis committed Oct 29, 2013
1 parent 8b10215 commit 89ec153
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 5 deletions.
9 changes: 8 additions & 1 deletion oscar/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ class Shop(Application):
offer_app = get_class('offer.app', 'application')

def get_urls(self):
#After we drop support for Django<1.6 the following line won't be
#necessary, and the parameter uidb36 should be replaced with uidb64.
#The necessary update should also be done in oscar/apps/customer/utils.py
password_reset_confirm = getattr(auth_views,
'password_reset_confirm_uidb36',
auth_views.password_reset_confirm)

urlpatterns = patterns('',
(r'^i18n/', include('django.conf.urls.i18n')),
(r'^catalogue/', include(self.catalogue_app.urls)),
Expand All @@ -44,7 +51,7 @@ def get_urls(self):
login_forbidden(auth_views.password_reset_done),
name='password-reset-done'),
url(r'^password-reset/confirm/(?P<uidb36>[0-9A-Za-z]{1,13})-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
login_forbidden(auth_views.password_reset_confirm),
login_forbidden(password_reset_confirm),
{'post_reset_redirect': reverse_lazy('password-reset-complete')},
name='password-reset-confirm'),
url(r'^password-reset/complete/$',
Expand Down
2 changes: 1 addition & 1 deletion oscar/apps/catalogue/abstract_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ class AbstractProductAttributeValue(models.Model):
value_text = models.CharField(
_('Text'), max_length=255, blank=True, null=True)
value_integer = models.IntegerField(_('Integer'), blank=True, null=True)
value_boolean = models.BooleanField(_('Boolean'), blank=True)
value_boolean = models.NullBooleanField(_('Boolean'), blank=True)
value_float = models.FloatField(_('Float'), blank=True, null=True)
value_richtext = models.TextField(_('Richtext'), blank=True, null=True)
value_date = models.DateField(_('Date'), blank=True, null=True)
Expand Down
4 changes: 3 additions & 1 deletion oscar/apps/customer/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def save(self, domain_override=None,
site = get_current_site(request)
if domain_override is not None:
site.domain = site.name = domain_override
for user in self.users_cache:
email = self.cleaned_data['email']
users = User._default_manager.filter(email__iexact=email)
for user in users:
# Build reset url
reset_url = "%s://%s%s" % (
'https' if use_https else 'http',
Expand Down
1 change: 1 addition & 0 deletions oscar/forms/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class ExtendedURLField(fields.URLField):
Custom field similar to URLField type field, however also accepting and
validating local relative URLs, ie. '/product/'
"""
default_validators = []

def __init__(self, max_length=None, min_length=None, verify_exists=None,
*args, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Development
django-debug-toolbar
django-debug-toolbar<=0.9.1
django-cache-panel
django-debug-toolbar-template-timings
django-extensions>=1.2.0,<1.3.0
Expand All @@ -18,7 +18,7 @@ coverage>=3.6,<3.7
django-nose>=1.1,<1.2
spec>=0.11.1,<0.12
WebTest>=2.0,<2.1
django-webtest>=1.5.7,<1.6
django-webtest>=1.7,<1.8
detox==0.9.2
coveralls>=0.1.1,<0.2
purl>=0.4
Expand Down
5 changes: 5 additions & 0 deletions sites/sandbox/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ def is_internal(request):
# Use a custom KV store to handle integrity error
THUMBNAIL_KVSTORE = 'oscar.sorl_kvstore.ConcurrentKVStore'

# Django has switched to JSON serializing for security reasons, but it does not
# serialize Models. We should resolve this by extending the
# django/core/serializers/json.Serializer to have the `dumps` function. Also
# in tests/config.py
SESSION_SERIALIZER='django.contrib.sessions.serializers.PickleSerializer'

# Try and import local settings which can be used to override any of the above.
try:
Expand Down
1 change: 1 addition & 0 deletions tests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def configure():
'DEBUG': False,
'SITE_ID': 1,
'APPEND_SLASH': True,
'SESSION_SERIALIZER': 'django.contrib.sessions.serializers.PickleSerializer',
}
if django.VERSION >= (1, 5):
test_settings['INSTALLED_APPS'] += ['tests._site.myauth', ]
Expand Down

0 comments on commit 89ec153

Please sign in to comment.