Skip to content

Commit

Permalink
Merge pull request #909 from koriaf/dev-no-socks-tests
Browse files Browse the repository at this point in the history
fix(tests): Run tests without the socks components and document their usage
  • Loading branch information
gwasser committed Nov 24, 2020
2 parents dcdfb1b + 4955d98 commit b9855ec
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ Django project.
For further installation information see `docs/install.html`
and `docs/configuration.html`

Testing
-------

See quicktest.py for usage details

Upgrading from previous versions
--------------------------------

Expand Down Expand Up @@ -111,3 +116,4 @@ We're happy to include any type of contribution! This can be:
For more information on contributing, please see the `CONTRIBUTING.rst` file.

.. _note: http://docs.djangoproject.com/en/dev/ref/databases/#sqlite-string-matching

5 changes: 4 additions & 1 deletion helpdesk/tests/test_get_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,10 @@ def test_read_email_cc(self):

# build matrix of test cases
case_methods = [c[0] for c in Queue._meta.get_field('email_box_type').choices]
case_socks = [False] + [c[0] for c in Queue._meta.get_field('socks_proxy_type').choices]

# uncomment if you want to run tests with socks - which is much slover
# case_socks = [False] + [c[0] for c in Queue._meta.get_field('socks_proxy_type').choices]
case_socks = [False]
case_matrix = list(itertools.product(case_methods, case_socks))

# Populate TestCases from the matrix of parameters
Expand Down
9 changes: 8 additions & 1 deletion quicktest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Usage:
$ python -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements-testing.txt -r requirements.txt
$ python ./quicktest.py
"""
import os
import sys
import argparse
Expand Down Expand Up @@ -65,7 +72,6 @@ class QuickDjangoTest(object):
},
]


def __init__(self, *args, **kwargs):
self.tests = args
self._tests()
Expand Down Expand Up @@ -102,6 +108,7 @@ def _tests(self):
if failures:
sys.exit(failures)


if __name__ == '__main__':
"""
What do when the user hits this file from the shell.
Expand Down

0 comments on commit b9855ec

Please sign in to comment.