From 5c84873a2efa6e4e52e9fadfdd6cc3243a1a0fe3 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Sat, 3 Mar 2012 13:47:54 +0000 Subject: [PATCH] Convert to a installable package --- .gitignore | 1 + __init__.py => django-testauth/__init__.py | 0 auth.py => django-testauth/auth.py | 6 +++--- tests.py => django-testauth/tests.py | 0 4 files changed, 4 insertions(+), 3 deletions(-) rename __init__.py => django-testauth/__init__.py (100%) rename auth.py => django-testauth/auth.py (88%) rename tests.py => django-testauth/tests.py (100%) diff --git a/.gitignore b/.gitignore index 0d20b64..27ffc2f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.pyc +build diff --git a/__init__.py b/django-testauth/__init__.py similarity index 100% rename from __init__.py rename to django-testauth/__init__.py diff --git a/auth.py b/django-testauth/auth.py similarity index 88% rename from auth.py rename to django-testauth/auth.py index 3d258e6..755f39e 100644 --- a/auth.py +++ b/django-testauth/auth.py @@ -7,9 +7,9 @@ from hashlib import sha1 from django.contrib.auth.models import User, check_password, Group import settings -class DredditAuthBackend: +class TESTAuthBackend: """ - Django authentication backend for authenticating against Dreddit's Auth System. + Django authentication backend for authenticating against TEST's Auth System. """ def authenticate(self, username=None, password=None): @@ -39,7 +39,7 @@ class DredditAuthBackend: if email: user.email = email - if hasattr(settings, 'DREDDIT_AUTH_CREATE_GROUPS') and settings.DREDDIT_AUTH_CREATE_GROUPS: + if getattr(settings, 'TEST_AUTH_CREATE_GROUPS', False): for g in groups: group, created = Group.objects.get_or_create(name=g['name']) user.groups.add(group) diff --git a/tests.py b/django-testauth/tests.py similarity index 100% rename from tests.py rename to django-testauth/tests.py