Skip to content

Commit

Permalink
Merge pull request #343 from cfpb/py3-testing
Browse files Browse the repository at this point in the history
Py3 testing
  • Loading branch information
higs4281 committed May 14, 2019
2 parents de0c679 + f30e32f commit 277ef0f
Show file tree
Hide file tree
Showing 48 changed files with 1,008 additions and 1,225 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ omit =
exclude_lines =
pragma: no cover
if __name__ == .__main__.:
if six.PY2:
22 changes: 22 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[flake8]
ignore =
# There's nothing wrong with assigning lambdas
E731,
# PEP8 weakly recommends Knuth-style line breaks before binary
# operators
W503, W504
exclude =
# These are directories that it's a waste of time to traverse
.eggs,
.env,
.git,
.tox,
.venv,
bin,
config,
docs,
gulp,
node_modules,
*/migrations/*.py,
paying_for_college/config/*
paying_for_college/disclosures/urls.py
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
language: python
python:
- '2.7'
- 2.7
- 3.6
install:
- pip install tox-travis
- npm install -g gulp-cli
- pip install coveralls tox
script:
- npm config set package-lock false
- tox
- python2.7 setup.py bdist_wheel --universal
- npm config set package-lock false
- npm test
- python2.7 setup.py bdist_wheel
- ls dist/*
- gulp lint --travis
- ls dist/*
after_success:
- coveralls
deploy:
Expand Down
9 changes: 7 additions & 2 deletions paying_for_college/admin.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/usr/bin/env python
from __future__ import absolute_import

from django.contrib import admin
from .models import School, Program, Alias, Nickname, Contact, Disclosure
from .models import BAHRate, Feedback, Worksheet, ConstantRate, ConstantCap

from paying_for_college.models import (
Alias, BAHRate, ConstantCap, ConstantRate, Contact, Disclosure, Feedback,
Nickname, Program, School, Worksheet
)


class DisclosureAdmin(admin.ModelAdmin):
Expand Down Expand Up @@ -41,6 +45,7 @@ class NicknameAdmin(admin.ModelAdmin):
list_display = ('nickname', 'institution', 'is_female')
search_fields = ['nickname']


admin.site.register(Disclosure, DisclosureAdmin)
admin.site.register(ConstantRate, ConstantRateAdmin)
admin.site.register(ConstantCap, ConstantCapAdmin)
Expand Down
4 changes: 3 additions & 1 deletion paying_for_college/config/settings/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from unipath import Path
import getpass

from unipath import Path


LOCAL_USER = getpass.getuser()
REPOSITORY_ROOT = Path(__file__).ancestor(4)
PROJECT_ROOT = Path(__file__).ancestor(3)
Expand Down
2 changes: 2 additions & 0 deletions paying_for_college/config/settings/dev.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from __future__ import absolute_import

import os

import dj_database_url

from .base import *


DEBUG = True

DATABASES = {
Expand Down
1 change: 1 addition & 0 deletions paying_for_college/config/settings/no_haystack.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .standalone import *


INSTALLED_APPS.remove('haystack')
2 changes: 2 additions & 0 deletions paying_for_college/config/settings/standalone.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from __future__ import absolute_import

from .dev import *


STANDALONE = True

SECRET_KEY = "forstandaloneonly"
Expand Down
9 changes: 4 additions & 5 deletions paying_for_college/config/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from django.conf.urls import url, include
from django.conf import settings
from paying_for_college.views import (LandingView,
BaseTemplateView,
URL_ROOT)
from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings

from paying_for_college.views import URL_ROOT, BaseTemplateView, LandingView


try:
STANDALONE = settings.STANDALONE
Expand Down
1 change: 1 addition & 0 deletions paying_for_college/config/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from django.core.wsgi import get_wsgi_application


os.environ.setdefault("DJANGO_SETTINGS_MODULE", "paying_for_college.config.settings.test")

application = get_wsgi_application()
Empty file.
Loading

0 comments on commit 277ef0f

Please sign in to comment.