mirror of
https://github.com/Hopiu/django-tos.git
synced 2026-05-26 02:33:43 +00:00
Add support for custom user models
This commit is contained in:
parent
10872ac2eb
commit
c6b9f6e8b6
3 changed files with 8 additions and 3 deletions
|
|
@ -1,8 +1,9 @@
|
|||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
class NoActiveTermsOfService(ValidationError):
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.test import TestCase
|
||||
from django.db.models.signals import post_syncdb
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
from tos.models import TermsOfService, UserAgreement, has_user_agreed_latest_tos
|
||||
|
||||
class TestModels(TestCase):
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test import TestCase
|
||||
|
||||
from tos.models import TermsOfService, UserAgreement, has_user_agreed_latest_tos
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
class TestViews(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue