This repository has been archived by the owner on Jun 5, 2018. It is now read-only.
forked from ericflo/django-pagination
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also move test.py file to tests directory
- Loading branch information
Showing
4 changed files
with
46 additions
and
14 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env python | ||
import django | ||
import doctest | ||
import sys | ||
|
||
from django.conf import settings | ||
|
||
|
||
def runtests(): | ||
if not settings.configured: | ||
# Configure test environment | ||
settings.configure( | ||
SECRET_KEY='fake-key', | ||
INSTALLED_APPS=( | ||
'linaro_django_pagination', | ||
), | ||
) | ||
|
||
try: | ||
django.setup() | ||
except AttributeError: # for Django 1.6 compatible | ||
pass | ||
|
||
from django.test.utils import get_runner | ||
|
||
TestRunner = get_runner(settings) | ||
test_runner = TestRunner() | ||
failures = test_runner.run_tests( | ||
["linaro_django_pagination.tests"], | ||
extra_tests=[doctest.DocTestSuite('linaro_django_pagination.tests.test_main')] | ||
) | ||
sys.exit(bool(failures)) | ||
|
||
|
||
if __name__ == '__main__': | ||
runtests() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters