@@ -0,0 +1,1686 @@
+from django.test import TestCase%0Afrom django.core.urlresolvers import reverse%0A%0Afrom ..models import PendingUser%0A%0A%0Aclass RegisterViewTestCase(TestCase):%0A    def test_view_loads(self):%0A        response = self.client.get(reverse('accounts:register'))%0A%0A        self.assertEqual(response.status_code, 200)%0A        self.assertTemplateUsed(response, 'accounts/register.html')%0A%0A    def test_register_view_form_valid(self):%0A        ''' The first and last name should be defined.%0A        The given email address should be a valid email. '''%0A%0A        # Try with correct informations%0A        self.client.post(%0A            reverse('accounts:register'),%0A            %7B'first_name': 'Potato',%0A                'last_name': 'Chips',%0A                'email': 'potato.chips@lustucru.org',%0A                'agreement': 'true'%7D,%0A        )%0A%0A        newUser = PendingUser.objects.filter(first_name='Potato')%0A        self.assertNotEqual(list(newUser), %5B%5D)%0A%0A        # Try with an incorrect email%0A        self.client.post(%0A            reverse('accounts:register'),%0A            %7B'first_name': 'Mister',%0A                'last_name': 'Tomaato',%0A                'email': 'randomfalseemail',%0A                'agreement': 'true'%7D,%0A        )%0A%0A        newUser2 = PendingUser.objects.filter(first_name='Mister')%0A        self.assertEqual(list(newUser2), %5B%5D)%0A%0A        # Try with no 'agreement' boolean%0A        self.client.post(%0A            reverse('accounts:register'),%0A            %7B'first_name': 'Little',%0A                'last_name': 'Cupcake',%0A                'email': 'little.cupcake@haribo.org'%7D%0A        )%0A%0A        newUser3 = PendingUser.objects.filter(first_name='Little')%0A        self.assertEqual(list(newUser3), %5B%5D)%0A

Add tests for registration view