# Path: userprofiles/contrib/accountverification/models.py
# class AccountVerification(models.Model):
#     ACTIVATED = 'ALREADY_ACTIVATED'
# 
#     user = models.ForeignKey(User, unique=True, verbose_name=_('User'))
#     activation_key = models.CharField(_('Activation key'), max_length=40)
# 
#     objects = AccountVerificationManager()
# 
#     def __unicode__(self):
#         return u'Account verification: %s' % self.user
# 
#     def activation_key_expired(self):
#         expiration_date = timedelta(days=up_settings.ACCOUNT_VERIFICATION_DAYS)
#         return (self.activation_key == self.ACTIVATED
#             or (self.user.date_joined + expiration_date <= timezone.now()))
#     activation_key_expired.boolean = True
# 
#     class Meta:
#         app_label = 'userprofiles'
#         verbose_name = _('Account verification')
#         verbose_name_plural = _('Account verifications')


import re
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
from userprofiles.contrib.accountverification.models import AccountVerification




@override_settings(USE_ACCOUNT_VERIFICATION=True)
class ViewTests(TestCase):
    def setUp(self):
        self.data = {
            'username': 'newuser',
            'email': 'newuser@example.com',
            'password': 'newuserpass',
        }

    def test_registration_activate(self):

# Path: userprofiles/contrib/accountverification/models.py
# class AccountVerification(models.Model):
#     ACTIVATED = 'ALREADY_ACTIVATED'
# 
#     user = models.ForeignKey(User, unique=True, verbose_name=_('User'))
#     activation_key = models.CharField(_('Activation key'), max_length=40)
# 
#     objects = AccountVerificationManager()
# 
#     def __unicode__(self):
#         return u'Account verification: %s' % self.user
# 
#     def activation_key_expired(self):
#         expiration_date = timedelta(days=up_settings.ACCOUNT_VERIFICATION_DAYS)
#         return (self.activation_key == self.ACTIVATED
#             or (self.user.date_joined + expiration_date <= timezone.now()))
#     activation_key_expired.boolean = True
# 
#     class Meta:
#         app_label = 'userprofiles'
#         verbose_name = _('Account verification')
#         verbose_name_plural = _('Account verifications')


# Path: userprofiles/contrib/accountverification/tests/test_views.py
import re
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
from userprofiles.contrib.accountverification.models import AccountVerification





@override_settings(USE_ACCOUNT_VERIFICATION=True)
class ViewTests(TestCase):
    def setUp(self):
        self.data = {
            'username': 'newuser',
            'email': 'newuser@example.com',
            'password': 'newuserpass',
        }

    def test_registration_activate(self):

        AccountVerification.objects.create_inactive_user(