From ca151d57c3f0311d9703e3e2beaa2f7e9eab16e1 Mon Sep 17 00:00:00 2001 From: duker Date: Fri, 22 Jun 2018 16:21:34 +0300 Subject: [PATCH] #360 Fix commented test and refarm-site dependency --- requirements.txt | 2 +- shopelectro/tests/tests_views.py | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index 3d530eae..4f2b771e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,4 +18,4 @@ ua-parser==0.8.0 user-agents==1.1.0 sorl-thumbnail==12.4a1 https://github.com/selwin/django-user_agents/archive/master.zip -https://github.com/fidals/refarm-site/archive/0.1.6.zip +https://github.com/fidals/refarm-site/archive/0.1.3.zip diff --git a/shopelectro/tests/tests_views.py b/shopelectro/tests/tests_views.py index def98f84..0bbb5f51 100644 --- a/shopelectro/tests/tests_views.py +++ b/shopelectro/tests/tests_views.py @@ -14,11 +14,13 @@ from bs4 import BeautifulSoup from django.conf import settings +from django.contrib.sites.models import Site from django.db.models import Q from django.http import HttpResponse from django.test import TestCase from django.urls import reverse from django.utils.translation import ugettext as _ +from redirects.models import Redirect from shopelectro.models import Category, Product, Tag, TagGroup, TagQuerySet, serialize_tags_to_url from shopelectro.views.service import generate_md5_for_ya_kassa, YANDEX_REQUEST_PARAM @@ -523,7 +525,8 @@ class Redirects(TestCase): fixtures = ['dump.json'] - @unittest.expectedFailure('rf#140 task will resurrect it') + # rf#140 task will resurrect this test + @unittest.expectedFailure def test_redirect_on_existing_page(self): """DB based redirect from existing url should do, but should not avoid it.""" # take some existing `url_from` @@ -532,11 +535,6 @@ def test_redirect_on_existing_page(self): self.assertEqual(response.status_code, 200) # create redirect from `url_from` to another existing one - `url_to` - from django.contrib.redirects.models import Redirect - from django.contrib.sites.models import Site - - # Site.objects.create(domain='shopelectro.ru', name='shopelectro') - url_to = '/catalog/categories/category-0/' Redirect.objects.create( site=Site.objects.first(),