-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unittests & continuous integration #63
Open
EvaSDK
wants to merge
12
commits into
johnsensible:master
Choose a base branch
from
lexfo:unittests-continuous-integration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2d12b53
Py3, django 1.7 for example app, wheel support, tox
NotSqrt 31ceca3
Update .gitignore
NotSqrt 491913a
Merge pull request #28 from NotSqrt/master
EvaSDK 7d4ec98
Compress test matrix and update with new Django versions
EvaSDK 2d9ef94
Add Travis CI integration
EvaSDK b30328e
Reduce support to currently supported Django versions
EvaSDK 20d8a2c
Fix declaration of applications URLs in unittests
EvaSDK b8d4ae1
Fix encoding issue with python3 in sendfile function
EvaSDK bb61055
Fix encoding issue with python3 in unittests
EvaSDK 727bb7c
Fix encoding issue with python3 in xsendfile backend
EvaSDK 45f6ffe
Add Travis CI build badge
48b6319
Drop remaining unicode markers for python2
EvaSDK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
|
@@ -9,3 +9,4 @@ | |
/lib | ||
/build | ||
.Python | ||
.tox |
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,30 @@ | ||
dist: trusty | ||
sudo: false | ||
language: python | ||
cache: pip | ||
matrix: | ||
include: | ||
- python: '2.7' | ||
env: DJANGO=django18 | ||
- python: '2.7' | ||
env: DJANGO=django110 | ||
- python: '2.7' | ||
env: DJANGO=django111 | ||
- python: '3.2' | ||
env: DJANGO=django18 | ||
- python: '3.3' | ||
env: DJANGO=django18 | ||
- python: '3.4' | ||
env: DJANGO=django110 | ||
- python: '3.4' | ||
env: DJANGO=django111 | ||
- python: '3.5' | ||
env: DJANGO=django110 | ||
- python: '3.5' | ||
env: DJANGO=django111 | ||
- python: '3.6' | ||
env: DJANGO=django111 | ||
install: | ||
- pip install tox | ||
script: | ||
- tox -e py${TRAVIS_PYTHON_VERSION//.}-${DJANGO} -- -v 2 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class DownloadAppConfig(AppConfig): | ||
name = 'download' |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from django.conf.urls.defaults import * | ||
from django.conf.urls import url | ||
|
||
from .views import download, download_list | ||
|
||
urlpatterns = patterns('', | ||
urlpatterns = [ | ||
url(r'^$', download_list), | ||
url(r'(?P<download_id>\d+)/$', download, name='download'), | ||
) | ||
] |
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
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,9 @@ | ||
from django.conf.urls import url, include | ||
|
||
from django.contrib import admin | ||
admin.autodiscover() | ||
|
||
urlpatterns = [ | ||
url(r'^', include('download.urls')), | ||
url(r'^admin/', include(admin.site.urls)), | ||
] |
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 |
---|---|---|
@@ -1,14 +1,10 @@ | ||
#!/usr/bin/env python | ||
import os | ||
import sys | ||
|
||
from __future__ import absolute_import | ||
if __name__ == "__main__": | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings") | ||
|
||
from django.core.management import execute_manager | ||
try: | ||
from . import settings # Assumed to be in the same directory. | ||
except ImportError: | ||
import sys | ||
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) | ||
sys.exit(1) | ||
from django.core.management import execute_from_command_line | ||
|
||
if __name__ == "__main__": | ||
execute_manager(settings) | ||
execute_from_command_line(sys.argv) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
from django.http import HttpResponse | ||
import six | ||
|
||
|
||
def sendfile(request, filename, **kwargs): | ||
response = HttpResponse() | ||
response['X-Sendfile'] = unicode(filename).encode('utf-8') | ||
if six.PY2: | ||
response['X-Sendfile'] = unicode(filename).encode('utf-8') | ||
else: | ||
response['X-Sendfile'] = filename | ||
|
||
return response |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[wheel] | ||
# create "py2.py3-none-any.whl" package | ||
universal = 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Tox (http://codespeak.net/~hpk/tox/) is a tool for running tests | ||
# in multiple virtualenvs. This configuration file will run the | ||
# test suite on all supported python versions. To use it, "pip install tox" | ||
# and then run "tox" from this directory. | ||
|
||
[tox] | ||
minversion = 2.2 | ||
envlist = | ||
py{27,32,33,34}-django18 | ||
py{27,34,35}-django110 | ||
py{27,34,35,36}-django111 | ||
skip_missing_interpreters = True | ||
|
||
[testenv] | ||
changedir = examples/protected_downloads | ||
commands = python manage.py test sendfile | ||
deps = | ||
six | ||
django18: django >=1.8,<1.9 | ||
django110: django >=1.10,<1.11 | ||
django111: django >=1.11,<2 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #62 I've fixed the tests so they can be run at the project top level. If that lands, I don't think this
changedir
will be required.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, I just picked up from #28, hence the status of this branch.