Rename ExplorerCreationForm to SignupVoucherForm.

This commit is contained in:
Marcus Scholz 2020-12-24 20:25:05 +01:00
parent 3a20a60f05
commit 3855fb28d7
3 changed files with 8 additions and 8 deletions

View File

@ -10,7 +10,7 @@ from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from lostplaces.models import Place, PlaceImage, Voucher
class ExplorerCreationForm(UserCreationForm):
class SignupVoucherForm(UserCreationForm):
class Meta:
model = User
fields = ('username', 'email', 'first_name', 'last_name')

View File

@ -4,15 +4,15 @@ from django import forms
from django.utils import timezone
from lostplaces.tests.forms import FormTestCase
from lostplaces.forms import ExplorerCreationForm
from lostplaces.forms import SignupVoucherForm
from lostplaces.models.models import Voucher
class ExplorerCreationFormTestCase(FormTestCase):
class SignupVoucherFormTestCase(FormTestCase):
"""
This test case only tests for the voucher since all other aspects don't realy matter
to this project and are already tested by django
"""
form = ExplorerCreationForm
form = SignupVoucherForm
@classmethod
def setUpTestData(cls):
@ -37,7 +37,7 @@ class ExplorerCreationFormTestCase(FormTestCase):
)
def test_validation_valid(self):
form = ExplorerCreationForm(self.post_data)
form = SignupVoucherForm(self.post_data)
self.assertTrue(
form.is_valid(),
msg='Expecting the %s to validate' % (
@ -49,7 +49,7 @@ class ExplorerCreationFormTestCase(FormTestCase):
self.post_data = {
'voucher': 'Imanotacode123'
}
form = ExplorerCreationForm(self.post_data)
form = SignupVoucherForm(self.post_data)
self.assertFalse(
form.is_valid(),
msg='Expecting the %s to not validate' % (

View File

@ -11,7 +11,7 @@ from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponseForbidden
from django.utils.translation import ugettext_lazy as _
from lostplaces.forms import ExplorerCreationForm, TagSubmitForm
from lostplaces.forms import SignupVoucherForm, TagSubmitForm
from lostplaces.models import Place, PhotoAlbum
from lostplaces.views.base_views import IsAuthenticatedMixin
@ -23,7 +23,7 @@ from lostplaces.views.base_views import (
from taggit.models import Tag
class SignUpView(SuccessMessageMixin, CreateView):
form_class = ExplorerCreationForm
form_class = SignupVoucherForm
success_url = reverse_lazy('login')
template_name = 'signup.html'
success_message = _('User created')