This repository has been archived by the owner on Feb 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from michaelmior/fix-tests
Fix vanilla and tox tests
- Loading branch information
Showing
7 changed files
with
58 additions
and
28 deletions.
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
*.pyc | ||
*.sqlite | ||
docs/build | ||
docs/build | ||
.tox | ||
build/ | ||
django_oauth.egg-info/ |
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,20 @@ | ||
[ | ||
{ | ||
"pk": 1, | ||
"model": "auth.user", | ||
"fields": { | ||
"username": "testuser", | ||
"first_name": "", | ||
"last_name": "", | ||
"is_active": true, | ||
"is_superuser": true, | ||
"is_staff": true, | ||
"last_login": "1980-01-01 00:00", | ||
"groups": [], | ||
"user_permissions": [], | ||
"password": "pbkdf2_sha256$10000$T6FFzJNPKkLe$O15V3Z3/MxzBCUDsBCB2/YietIDjtMBwhjj+5JY3JPQ=", | ||
"email": "[email protected]", | ||
"date_joined": "1980-01-01 00:00" | ||
} | ||
} | ||
] |
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 |
---|---|---|
|
@@ -5,16 +5,13 @@ | |
|
||
|
||
class OAuthServerTest(TestCase): | ||
fixtures = ['test_entries.json'] | ||
fixtures = ['test_user.json', 'test_entries.json'] | ||
|
||
def setUp(self): | ||
super(OAuthServerTest, self).setUp() | ||
|
||
# Credentials | ||
self.username = 'testuser' | ||
self.password = 'pass' | ||
self.user = User.objects.create_user( | ||
self.username, '[email protected]', self.password) | ||
self.user = User.objects.get(pk=1) | ||
|
||
# Object to test on | ||
self.clientcredentials = ClientCredential.objects.get(pk=1) | ||
|
@@ -279,19 +276,19 @@ def test_get_access_token_secret(self): | |
# | ||
# uri, headers, body = c.sign(u'http://127.0.0.1:8001/initiate/') | ||
|
||
#TODO nonce/timestamp/signature will change | ||
self.assertEqual( | ||
headers, | ||
{ | ||
u'Authorization': u'OAuth oauth_nonce=' | ||
u'"110880830699442379541341263567",' | ||
u'oauth_timestamp="1341263567", oauth_version="1.0",' | ||
u'oauth_signature_method="HMAC-SHA1",' | ||
u'oauth_consumer_key=self.clientcredentials.key,' | ||
u'oauth_callback=self.clientcredentials.callback,' | ||
u'oauth_signature="1emEeMqMx1vgjKEwdwyrz57%2FyTE%3D"', | ||
} | ||
) | ||
# #TODO nonce/timestamp/signature will change | ||
# self.assertEqual( | ||
# headers, | ||
# { | ||
# u'Authorization': u'OAuth oauth_nonce=' | ||
# u'"110880830699442379541341263567",' | ||
# u'oauth_timestamp="1341263567", oauth_version="1.0",' | ||
# u'oauth_signature_method="HMAC-SHA1",' | ||
# u'oauth_consumer_key=self.clientcredentials.key,' | ||
# u'oauth_callback=self.clientcredentials.callback,' | ||
# u'oauth_signature="1emEeMqMx1vgjKEwdwyrz57%2FyTE%3D"', | ||
# } | ||
# ) | ||
|
||
# s = OAuthServer() | ||
# self.assertTrue(s.verify_request(uri, body=body, headers=headers)) | ||
|
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 |
---|---|---|
|
@@ -11,11 +11,11 @@ def read_file(filename): | |
return '' | ||
|
||
setup( | ||
name='django-{{ app_name }}', | ||
version=__import__('{{ app_name }}').__version__, | ||
name='django-oauth', | ||
version=__import__('oauth').__version__, | ||
author='Craig Bruce', | ||
author_email='[email protected]', | ||
description=u' '.join(__import__('{{ app_name }}').__doc__.splitlines()).strip(), | ||
description=u' '.join(__import__('oauth').__doc__.splitlines()).strip(), | ||
license='BSD', | ||
keywords='django oauth provider', | ||
url='https://github.com/craigbruce/django-oauthlib', | ||
|
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