Skip to content

Conversation

@troygrosfield
Copy link
Collaborator

This should get the tests for django 1.7 running successfully.

Fixes #496, ping #493.

@troygrosfield
Copy link
Collaborator Author

Strange this fail with travis because it works for me locally using py3.4.2, django 1.7.1:

facebook_example git:(master) python manage.py test django_facebook --settings=facebook_example.settings -v2
Creating test database for alias 'default' (':memory:')...
System check identified some issues:

WARNINGS:
?: (1_6.W001) Some project unittests may not execute as expected.
    HINT: Django 1.6 introduced a new default test runner. It looks like this project was generated using Django 1.5 or earlier. You should ensure your tests are all running & behaving as expected. See https://docs.djangoproject.com/en/dev/releases/1.6/#new-test-runner for more information.
Operations to perform:
  Synchronize unmigrated apps: open_facebook, member, django_facebook
  Apply all migrations: auth, admin, contenttypes, sessions, sites
Synchronizing apps without migrations:
  Creating tables...
    Creating table django_facebook_facebookuser
    Creating table django_facebook_facebooklike
    Creating table django_facebook_facebookprofile
    Creating table django_facebook_facebookcustomuser_groups
    Creating table django_facebook_facebookcustomuser_user_permissions
    Creating table django_facebook_facebookcustomuser
    Creating table django_facebook_open_graph_share
    Creating table member_userprofile
  Installing custom SQL...
  Installing indexes...
System check identified some issues:

WARNINGS:
?: (1_6.W001) Some project unittests may not execute as expected.
    HINT: Django 1.6 introduced a new default test runner. It looks like this project was generated using Django 1.5 or earlier. You should ensure your tests are all running & behaving as expected. See https://docs.djangoproject.com/en/dev/releases/1.6/#new-test-runner for more information.
System check identified some issues:

WARNINGS:
?: (1_6.W001) Some project unittests may not execute as expected.
    HINT: Django 1.6 introduced a new default test runner. It looks like this project was generated using Django 1.5 or earlier. You should ensure your tests are all running & behaving as expected. See https://docs.djangoproject.com/en/dev/releases/1.6/#new-test-runner for more information.
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying sessions.0001_initial... OK
  Applying sites.0001_initial... OK
test_auth_backend (django_facebook.tests.AuthBackend) ... force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x103625828> for registration
profile facebook id changed from 1225707781 to None
found a new token new_user
access token changed, updating now
extending access token for user fake_new
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
[email protected] [email protected] [email protected]
ok
test_naming (django_facebook.tests.BaseDecoratorTest) ... ok
test_wrapping (django_facebook.tests.BaseDecoratorTest) ... ok
test_connect (django_facebook.tests.ConnectViewTest) ... trying to connect using Facebook
found a graph object
Facebook is authenticated
Django facebook performed action: <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
trying to connect using Facebook
found a graph object
Facebook is authenticated
Django facebook performed action: <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
trying to connect using Facebook
found a graph object
Facebook is authenticated
Django facebook performed action: <class 'django_facebook.connect.CONNECT_ACTIONS.LOGIN'>
trying to connect using Facebook
found a graph object
Facebook is authenticated
Django facebook performed action: <class 'django_facebook.connect.CONNECT_ACTIONS.CONNECT'>
trying to connect using Facebook
found a graph object
Facebook is authenticated
Incomplete profile data encountered with error
Traceback (most recent call last):
  File "/Users/troy/.virtualenvs/py34_django17/lib/python3.4/site-packages/django_facebook/views.py", line 85, in _connect
    request, connect_facebook=connect_facebook)
  File "/Users/troy/.virtualenvs/py34_django17/lib/python3.4/site-packages/mock.py", line 955, in __call__
    return _mock_self._mock_call(*args, **kwargs)
  File "/Users/troy/.virtualenvs/py34_django17/lib/python3.4/site-packages/mock.py", line 1010, in _mock_call
    raise effect
django_facebook.exceptions.IncompleteProfileError
ok
test_connect_redirect (django_facebook.tests.ConnectViewTest) ... requesting access with redirect uri: http://testserver/facebook/connect/?attempt=1, error was Couldnt find an access token in the request or cookies
ok
test_connect_redirect_authenticated (django_facebook.tests.ConnectViewTest) ... trying to connect using Facebook
found a graph object
Facebook is authenticated
force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x1048b9400> for registration
profile facebook id changed from 1225707782 to None
found a new token short_user
access token changed, updating now
extending access token for user thierry_schellenbach
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
Django facebook performed action: <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
trying to connect using Facebook
found a graph object
Facebook is authenticated
force registration is set to None
found the same token short_user
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.LOGIN'>
Django facebook performed action: <class 'django_facebook.connect.CONNECT_ACTIONS.LOGIN'>
ok
test_connect_redirect_default (django_facebook.tests.ConnectViewTest) ... trying to connect using Facebook
found a graph object
Facebook is authenticated
force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x1048cd128> for registration
profile facebook id changed from 1225707782 to None
found a new token short_user
access token changed, updating now
extending access token for user thierry_schellenbach
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
Django facebook performed action: <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
ok
test_connect_redirect_not_authenticated (django_facebook.tests.ConnectViewTest) ...             Somehow Facebook is not giving us the permissions needed
            Lets cancel instead of endless redirects

trying to connect using Facebook
            Somehow Facebook is not giving us the permissions needed
            Lets cancel instead of endless redirects

trying to connect using Facebook
ok
test_slow_connect (django_facebook.tests.ConnectViewTest) ... trying to connect using Facebook
found a graph object
<class 'open_facebook.exceptions.FacebookSSLError'>, often caused by Facebook slowdown, error ()
Traceback (most recent call last):
  File "/Users/troy/.virtualenvs/py34_django17/lib/python3.4/site-packages/django_facebook/views.py", line 44, in connect
    response = _connect(request, graph)
  File "/Users/troy/.virtualenvs/py34_django17/lib/python3.4/site-packages/django_facebook/views.py", line 75, in _connect
    authenticated = converter.is_authenticated()
  File "/Users/troy/.virtualenvs/py34_django17/lib/python3.4/site-packages/mock.py", line 955, in __call__
    return _mock_self._mock_call(*args, **kwargs)
  File "/Users/troy/.virtualenvs/py34_django17/lib/python3.4/site-packages/mock.py", line 1010, in _mock_call
    raise effect
open_facebook.exceptions.FacebookSSLError: ()
trying to connect using Facebook
found a graph object
<class 'open_facebook.exceptions.FacebookURLError'>, often caused by Facebook slowdown, error <urlopen error <urlopen error _ssl.c:489: The handshake operation timed out>>
Traceback (most recent call last):
  File "/Users/troy/.virtualenvs/py34_django17/lib/python3.4/site-packages/django_facebook/views.py", line 44, in connect
    response = _connect(request, graph)
  File "/Users/troy/.virtualenvs/py34_django17/lib/python3.4/site-packages/django_facebook/views.py", line 75, in _connect
    authenticated = converter.is_authenticated()
  File "/Users/troy/.virtualenvs/py34_django17/lib/python3.4/site-packages/mock.py", line 955, in __call__
    return _mock_self._mock_call(*args, **kwargs)
  File "/Users/troy/.virtualenvs/py34_django17/lib/python3.4/site-packages/mock.py", line 1010, in _mock_call
    raise effect
open_facebook.exceptions.FacebookURLError: <urlopen error <urlopen error _ssl.c:489: The handshake operation timed out>>
ok
test_decorator_authenticated (django_facebook.tests.DecoratorTest) ... ok
test_decorator_denied (django_facebook.tests.DecoratorTest) ...             Somehow Facebook is not giving us the permissions needed
            Lets cancel instead of endless redirects

ok
test_decorator_not_authenticated (django_facebook.tests.DecoratorTest) ... requesting access with redirect uri: http://testserver/facebook/decorator_example/?attempt=1, error was None
ok
test_naming (django_facebook.tests.DecoratorTest) ... ok
test_wrapping (django_facebook.tests.DecoratorTest) ... ok
test_mapping (django_facebook.tests.ErrorMappingTest) ... Trying to match error code 200 to error class
Matched error on code (200, 299)
Matched error to class <class 'open_facebook.exceptions.PermissionException'>
ok
test_extend_token (django_facebook.tests.ExtendTokenTest) ... ok
test_auth_user (django_facebook.tests.FacebookCanvasMiddlewareTest) ... ok
test_non_auth_user (django_facebook.tests.FacebookCanvasMiddlewareTest) ... ok
test_referer (django_facebook.tests.FacebookCanvasMiddlewareTest) ... ok
test_user_denied (django_facebook.tests.FacebookCanvasMiddlewareTest) ... ok
test_get_persistent (django_facebook.tests.GraphAccessTest) ... ok
test_decorator_authenticated (django_facebook.tests.LazyDecoratorTest) ... ok
test_decorator_denied (django_facebook.tests.LazyDecoratorTest) ...             Somehow Facebook is not giving us the permissions needed
            Lets cancel instead of endless redirects

ok
test_decorator_not_authenticated (django_facebook.tests.LazyDecoratorTest) ... requesting access with redirect uri: http://testserver/facebook/lazy_decorator_example/?attempt=1, error was Couldnt find an access token in the request or cookies
ok
test_naming (django_facebook.tests.LazyDecoratorTest) ... ok
test_wrapping (django_facebook.tests.LazyDecoratorTest) ... ok
test_url (django_facebook.tests.OAuthUrlTest) ... ok
test_follow_og_share (django_facebook.tests.OpenGraphShareTest) ... ok
test_follow_og_share_error (django_facebook.tests.OpenGraphShareTest) ... Open graph share failed, writing message broken
new token required is False and token_changed is False
Open graph share failed, writing message permissions
new token required is True and token_changed is False
a new token is required, setting the flag on the user or profile
Open graph share failed, writing message permissions
new token required is False and token_changed is False
ok
test_decorator_authenticated (django_facebook.tests.ScopedDecoratorTest) ... ok
test_decorator_denied (django_facebook.tests.ScopedDecoratorTest) ...             Somehow Facebook is not giving us the permissions needed
            Lets cancel instead of endless redirects

ok
test_decorator_not_authenticated (django_facebook.tests.ScopedDecoratorTest) ... requesting access with redirect uri: http://testserver/facebook/decorator_example_scope/?attempt=1, error was None
ok
test_naming (django_facebook.tests.ScopedDecoratorTest) ... ok
test_type_error (django_facebook.tests.ScopedDecoratorTest) ... ok
test_wrapping (django_facebook.tests.ScopedDecoratorTest) ... ok
test_user_registered_signal (django_facebook.tests.SignalTest) ... running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x104869b70> for registration
profile facebook id changed from 1225707782 to None
ok
test_registration (django_facebook.tests.SimpleRegisterViewTest) ... ok
test_create_test_user (django_facebook.tests.TestUserTest) ... ok
test_current_user (django_facebook.tests.UserConnectTest) ... force registration is set to None
profile facebook id changed from 1225707780 to None
found a new token tschellenb
access token changed, updating now
extending access token for user tschellenbach
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.LOGIN'>
ok
test_double_username (django_facebook.tests.UserConnectTest) ... force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x1048cc080> for registration
profile facebook id changed from 1225707782 to None
found a new token short_user
access token changed, updating now
extending access token for user thierry_schellenbach
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x10362e198> for registration
profile facebook id changed from 1111111 to None
found a new token same_usern
access token changed, updating now
extending access token for user thierry_schellenbach1
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
ok
test_fb_update_required (django_facebook.tests.UserConnectTest) ... force registration is set to None
profile facebook id changed from 1225707780 to None
found a new token tschellenb
access token changed, updating now
extending access token for user tschellenbach
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.LOGIN'>
force registration is set to None
found the same token tschellenb
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.LOGIN'>
ok
test_full_connect (django_facebook.tests.UserConnectTest) ... force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x1048fe6d8> for registration
profile facebook id changed from 1225707782 to None
found a new token short_user
access token changed, updating now
extending access token for user thierry_schellenbach
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
force registration is set to None
found the same token short_user
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.LOGIN'>
force registration is set to None
found the same token short_user
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.CONNECT'>
force registration is set to None
found the same token short_user
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.LOGIN'>
ok
test_gender (django_facebook.tests.UserConnectTest) ... ok
test_gender_matching (django_facebook.tests.UserConnectTest) ... force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x1048695f8> for registration
profile facebook id changed from 555227728 to None
found a new token paul
access token changed, updating now
extending access token for user pveugen
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
ok
test_invalid_token (django_facebook.tests.UserConnectTest) ... ok
test_long_username (django_facebook.tests.UserConnectTest) ... force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x1048eab38> for registration
profile facebook id changed from 1225707782 to None
found a new token long_usern
access token changed, updating now
extending access token for user superduperlongusernamemorethan
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
ok
test_new_user (django_facebook.tests.UserConnectTest) ... force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x1048d6b00> for registration
profile facebook id changed from 1225707781 to None
found a new token new_user
access token changed, updating now
extending access token for user fake_new
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
ok
test_no_email_registration (django_facebook.tests.UserConnectTest) ... force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x1048eab00> for registration
ok
test_parallel_register (django_facebook.tests.UserConnectTest) ... force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x1048e25f8> for registration
profile facebook id changed from 1225707782 to None
found a new token short_user
access token changed, updating now
extending access token for user thierry_schellenbach
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
force registration is set to None
parallel register encountered, slower thread is doing a login
found the same token short_user
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.LOGIN'>
ok
test_persistent_graph (django_facebook.tests.UserConnectTest) ... force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x1048c9f60> for registration
profile facebook id changed from 1225707782 to None
found a new token short_user
access token changed, updating now
extending access token for user thierry_schellenbach
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
ok
test_registration_form (django_facebook.tests.UserConnectTest) ... force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x1049054e0> for registration
profile facebook id changed from 1225707782 to None
found a new token short_user
access token changed, updating now
extending access token for user Test form
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
ok
test_short_username (django_facebook.tests.UserConnectTest) ... force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x1048c90f0> for registration
profile facebook id changed from 1225707782 to None
found a new token short_user
access token changed, updating now
extending access token for user thierry_schellenbach
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
ok
test_update_access_token (django_facebook.tests.UserConnectTest) ... force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x1048fdf28> for registration
profile facebook id changed from 555227728 to None
found a new token paul
access token changed, updating now
extending access token for user pveugen
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
and the token is paul2
force registration is set to None
found a new token paul2
access token changed, updating now
extending access token for user pveugen
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.LOGIN'>
ok
test_utf8 (django_facebook.tests.UserConnectTest) ... force registration is set to None
running backend <django_facebook.registration_backends.FacebookRegistrationBackend object at 0x1048cccf8> for registration
profile facebook id changed from 1157872766 to None
found a new token unicode_st
access token changed, updating now
extending access token for user fernandaferrervazquez
Facebook provided the same token, which expires at 60 days, 0:00:00
connect finished with action <class 'django_facebook.connect.CONNECT_ACTIONS.REGISTER'>
ok

----------------------------------------------------------------------
Ran 54 tests in 3.400s

OK

@troygrosfield
Copy link
Collaborator Author

@tschellenbach, these tests pass locally for me using py 3.4.2 and django 1.7.1. These changes in this PR will have to happen for the django 1.7 branch as recommended by django and south:

Tests are still passing as they originally were with django 1.6.8 and python 2.7.8. I would recommend merging this PR as it gets us closer to compatibility with py 3.4 and django 1.7.1 (as mentioned, it works for me locally).

@tschellenbach
Copy link
Owner

Thanks for the contribution Troy, one step closer!

tschellenbach added a commit that referenced this pull request Oct 25, 2014
Get tests successfully running for python 3.4 and django 1.7
@tschellenbach tschellenbach merged commit 97157b6 into tschellenbach:master Oct 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get travis running successfully for python 3.x, django 1.7

2 participants