Skip to content
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

Django2 #612

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ bulkloader-*

#app specific
facebook_example/django_fb_test
facebook_example/facebook_example_db
facebook_example/media/*

# ignore uploaded test images
Expand Down
41 changes: 14 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,30 @@
language: python
python:
- 2.7
- 3.4
- 3.5
- 3.6
notifications:
email:
- [email protected]
env:
# test the standalone functionality (skipping django 1.10 to minimize the number of machines used on Travis)
- DJANGO=">=1.8,<1.9" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
- DJANGO=">=1.8,<1.9" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
- DJANGO=">=1.9,<1.10" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
- DJANGO=">=1.9,<1.10" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
- DJANGO=">=1.11,<1.12" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
- DJANGO=">=1.11,<1.12" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
- DJANGO=">=1.11,<2" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS="django_facebook open_facebook"
- DJANGO=">=1.11,<2" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS="django_facebook open_facebook"
- DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS="django_facebook open_facebook"
- DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS="django_facebook open_facebook"
matrix:
exclude:
- python: 3.5
env: DJANGO=">=1.8,<1.9" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
- python: 3.5
env: DJANGO=">=1.8,<1.9" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
postgres:
adapter: sqlite3
database: django_fb_test
- python: 2.7
env: DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS="django_facebook open_facebook"
- python: 2.7
env: DJANGO=">=2.0.0,<2.1" CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS="django_facebook open_facebook"
install:
# faster than installing PIL manually
- pip install pep8
- pip install coverage
- pip install python-coveralls
- pip install https://github.com/dcramer/pyflakes/tarball/master
- python setup.py install
- pip install -r facebook_example/requirements/$REQUIREMENTS.txt -I --allow-all-external
- pip install Django$DJANGO
before_script:
- "pep8 --exclude=south_migrations --ignore=E501,E225,W293,E731 django_facebook open_facebook"
# - pyflakes -x W src
- pip install coverage python-coveralls pipenv
- pipenv run pip install Django$DJANGO
- pipenv sync -d

script:
- pip uninstall -y django-facebook && pip install -e .
- cd facebook_example
- coverage run manage.py test $TESTS --settings=$SETTINGS -v2
- pipenv run coverage run manage.py test $TESTS --settings=$SETTINGS -v2
after_success:
- coveralls
17 changes: 17 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
Unidecode = "*"

[dev-packages]
pytest = "==3.5.0"
"e1839a8" = {path = ".", editable = true}
pillow = "*"
pycodestyle = "*"
mock = "*"

[requires]
python_version = "3.6"
148 changes: 148 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion django_facebook/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.contrib import admin
from django.conf import settings
from django.core.urlresolvers import reverse
from django.urls import reverse
from django_facebook import admin_actions
from django_facebook import models
from django_facebook import settings as facebook_settings
Expand Down
6 changes: 3 additions & 3 deletions django_facebook/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def get_facebook_graph(request=None, access_token=None, redirect_uri=None, raise
raise
else:
return None
elif request.user.is_authenticated():
elif request.user.is_authenticated:
# support for offline access tokens stored in the users profile
profile = try_get_profile(request.user)
access_token = get_user_attribute(
Expand Down Expand Up @@ -250,7 +250,7 @@ def _add_current_user_id(graph, user):
if graph:
graph.current_user_id = None

if user.is_authenticated():
if user.is_authenticated:
profile = try_get_profile(user)
facebook_id = get_user_attribute(user, profile, 'facebook_id')
if facebook_id:
Expand All @@ -275,7 +275,7 @@ def __init__(self, open_facebook):
self._profile = None

def is_authenticated(self):
return self.open_facebook.is_authenticated()
return self.open_facebook.is_authenticated

def facebook_registration_data(self, username=True):
'''
Expand Down
Loading