Skip to content

Commit 97157b6

Browse files
committed
Merge pull request #497 from troygrosfield/master
Get tests successfully running for python 3.4 and django 1.7
2 parents fb692bd + d246d61 commit 97157b6

File tree

7 files changed

+22
-18
lines changed

7 files changed

+22
-18
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ bulkloader-*
2424
facebook_example/django_fb_test
2525
facebook_example/media/*
2626

27+
# ignore uploaded test images
28+
facebook_example/facebook_example/media/*
29+
2730
#hide the docs and coverage
2831
html
2932
htmlcov
3033

3134
# But allow the gitignore file
32-
!.gitignore
33-
34-
35+
!.gitignore

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ notifications:
77
88
env:
99
# test the standalone functionality
10-
- DJANGO=1.6.5 CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development6 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
11-
- DJANGO=1.6.5 CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development6 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
12-
- DJANGO=1.7 CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
13-
- DJANGO=1.7 CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
10+
- DJANGO=1.6.8 CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development6 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
11+
- DJANGO=1.6.8 CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development6 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
12+
- DJANGO=1.7.1 CUSTOM_USER_MODEL=0 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
13+
- DJANGO=1.7.1 CUSTOM_USER_MODEL=1 MODE=standalone REQUIREMENTS=development7 SETTINGS=facebook_example.settings TESTS=django_facebook open_facebook
1414
postgres:
1515
adapter: sqlite3
1616
database: django_fb_test
@@ -24,7 +24,7 @@ install:
2424
- pip install -r facebook_example/requirements/$REQUIREMENTS.txt --use-mirrors -I --allow-all-external
2525
- pip install -q Django==$DJANGO --use-mirrors -I
2626
before_script:
27-
- "pep8 --exclude=migrations --ignore=E501,E225,W293 django_facebook open_facebook"
27+
- "pep8 --exclude=south_migrations --ignore=E501,E225,W293 django_facebook open_facebook"
2828
# - pyflakes -x W src
2929
script:
3030
- pip install -e .

django_facebook/migrations/0001_initial.py renamed to django_facebook/south_migrations/0001_initial.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def forwards(self, orm):
9696
('state', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
9797
))
9898
db.send_create_signal(u'django_facebook', ['FacebookCustomUser'])
99-
99+
100100
# Adding M2M table for field groups on 'FacebookCustomUser'
101101
m2m_table_name = db.shorten_name(u'django_facebook_facebookcustomuser_groups')
102102
db.create_table(m2m_table_name, (
@@ -105,7 +105,7 @@ def forwards(self, orm):
105105
('group', models.ForeignKey(orm[u'auth.group'], null=False))
106106
))
107107
db.create_unique(m2m_table_name, ['facebookcustomuser_id', 'group_id'])
108-
108+
109109
# Adding M2M table for field user_permissions on 'FacebookCustomUser'
110110
m2m_table_name = db.shorten_name(u'django_facebook_facebookcustomuser_user_permissions')
111111
db.create_table(m2m_table_name, (
@@ -271,4 +271,4 @@ def backwards(self, orm):
271271
}
272272
}
273273

274-
complete_apps = ['django_facebook']
274+
complete_apps = ['django_facebook']

facebook_example/facebook_example/settings.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
if DJANGO != '1.5.1':
1212
CUSTOM_USER_MODEL = False
13-
13+
1414
TESTING = 'test' in sys.argv
1515

1616
FACEBOOK_APP_ID = '215464901804004'
@@ -28,7 +28,7 @@
2828

2929
if django_version >= (1, 4, 0):
3030
TEMPLATE_CONTEXT_PROCESSORS.append('django.core.context_processors.tz')
31-
31+
3232
AUTHENTICATION_BACKENDS = (
3333
'django_facebook.auth_backends.FacebookBackend',
3434
'django.contrib.auth.backends.ModelBackend',
@@ -162,12 +162,15 @@
162162
# 'django.contrib.admindocs',
163163
'django_facebook',
164164
'member',
165-
'south',
166165
'open_facebook',
167166
'django.contrib.admin',
168167
)
169168

170-
169+
if django_version < (1, 7, 0):
170+
# south isn't needed by django >= 1.7 since migrations were added. See:
171+
# - https://docs.djangoproject.com/en/dev/topics/migrations/#libraries-third-party-apps
172+
# - http://south.readthedocs.org/en/latest/releasenotes/1.0.html#library-migration-path
173+
INSTALLED_APPS += ('south',)
171174

172175
# A sample logging configuration. The only tangible logging
173176
# performed by this configuration is to send an email to
@@ -259,4 +262,4 @@
259262
'guardian',
260263
)
261264

262-
FACEBOOK_OG_SHARE_DB_TABLE = 'django_facebook_open_graph_share'
265+
FACEBOOK_OG_SHARE_DB_TABLE = 'django_facebook_open_graph_share'

open_facebook/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ def test_albums(self):
333333
if profile_album:
334334
pictures = graph.get('%s/photos' % profile_album['id'])['data'][:3]
335335
for picture in pictures:
336-
print picture['source']
336+
print(picture['source'])
337337
if cover_album:
338338
pictures = graph.get('%s/photos' % cover_album['id'])['data'][:3]
339339
for picture in pictures:
340-
print picture['source']
340+
print(picture['source'])

0 commit comments

Comments
 (0)