[Python-modules-commits] [python-social-auth] 02/89: Add ability to store arbitrary user fields in test user model
Wolfgang Borgert
debacle at moszumanska.debian.org
Sat Dec 24 15:14:50 UTC 2016
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to tag v0.2.15
in repository python-social-auth.
commit 15d75dad20af14ae6772b6a70375b2728de1015a
Author: Nick Catalano <nickcatal at gmail.com>
Date: Wed Sep 30 02:25:57 2015 -0500
Add ability to store arbitrary user fields in test user model
---
social/tests/models.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/social/tests/models.py b/social/tests/models.py
index d5d193c..d142d92 100644
--- a/social/tests/models.py
+++ b/social/tests/models.py
@@ -24,7 +24,7 @@ class User(BaseModel):
cache = {}
_is_active = True
- def __init__(self, username, email=None):
+ def __init__(self, username, email=None, **extra_user_fields):
self.id = User.next_id()
self.username = username
self.email = email
@@ -32,6 +32,7 @@ class User(BaseModel):
self.slug = None
self.social = []
self.extra_data = {}
+ self.extra_user_fields = extra_user_fields
self.save()
def is_active(self):
@@ -100,8 +101,8 @@ class TestUserSocialAuth(UserMixin, BaseModel):
return User.cache.get(username) is not None
@classmethod
- def create_user(cls, username, email=None):
- return User(username=username, email=email)
+ def create_user(cls, username, email=None, **extra_user_fields):
+ return User(username=username, email=email, **extra_user_fields)
@classmethod
def get_user(cls, pk):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-social-auth.git
More information about the Python-modules-commits
mailing list