Skip to content

Commit ba668df

Browse files
humitosagjohnson
authored andcommitted
Define the doc_search reverse URL from inside the __init__ on test (#4703)
* Define the doc_search reverse URL from inside the __init__ on test Since we import this file from Corporate site without defining this URL name, this blow up. By defining it inside the __init__ method we workaround this. * Proper astroid version for Python2 and Python3
1 parent 4c2fe1e commit ba668df

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

readthedocs/search/tests/test_api.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
@pytest.mark.django_db
1212
@pytest.mark.search
1313
class TestDocumentSearch(object):
14-
url = reverse('doc_search')
14+
15+
def __init__(self):
16+
# This reverse needs to be inside the ``__init__`` method because from
17+
# the Corporate site we don't define this URL if ``-ext`` module is not
18+
# installed
19+
self.url = reverse('doc_search')
1520

1621
@pytest.mark.parametrize('data_type', ['content', 'headers', 'title'])
1722
@pytest.mark.parametrize('page_num', [0, 1])

requirements/lint.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
-r pip.txt
2-
astroid==2.0.4
2+
astroid==2.0.4; python_version > '3'
3+
astroid==1.6.4; python_version < '3'
34
pylint==2.1.1
45
pylint-django==2.0.2
56
pylint-celery==0.3

0 commit comments

Comments
 (0)