# Path: userprofiles/settings.py
# class Settings(object):
#     def __init__(self, **kwargs):
#     def __getattr__(self, key):
# def validate_settings():


from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
from userprofiles.settings import up_settings



class ViewTests(TestCase):
    def setUp(self):
        self.data = {
            'username': 'newuser',
            'email': 'newuser@example.com',
            'email_repeat': 'newuser@example.com',
            'password': 'newuserpass',
            'password_repeat': 'newuserpass',
            'first_name': 'New',
            'last_name': 'User',
        }

    def test_registration(self):
        url = reverse('userprofiles_registration')
        response = self.client.get(url)
        self.assertEqual(response.status_code, 200)

        response = self.client.post(url, data=self.data)

        self.assertEqual(response.status_code, 302)
        self.assertRedirects(response,

# Path: userprofiles/settings.py
# class Settings(object):
#     def __init__(self, **kwargs):
#     def __getattr__(self, key):
# def validate_settings():


# Path: userprofiles/tests/test_views.py
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
from userprofiles.settings import up_settings




class ViewTests(TestCase):
    def setUp(self):
        self.data = {
            'username': 'newuser',
            'email': 'newuser@example.com',
            'email_repeat': 'newuser@example.com',
            'password': 'newuserpass',
            'password_repeat': 'newuserpass',
            'first_name': 'New',
            'last_name': 'User',
        }

    def test_registration(self):
        url = reverse('userprofiles_registration')
        response = self.client.get(url)
        self.assertEqual(response.status_code, 200)

        response = self.client.post(url, data=self.data)

        self.assertEqual(response.status_code, 302)
        self.assertRedirects(response,

                             reverse(up_settings.REGISTRATION_REDIRECT))