Skip to content
Snippets Groups Projects
Commit f03ea893 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Ensure that title is included in the tests and full_name works on create

parent 3ae43f89
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,11 @@ class RadioFieldBlockFactory(FormFieldBlockFactory):
model = stream_blocks.RadioButtonsFieldBlock
class TitleBlockFactory(FormFieldBlockFactory):
class Meta:
model = blocks.TitleBlock
class EmailBlockFactory(FormFieldBlockFactory):
class Meta:
model = blocks.EmailBlock
......@@ -51,6 +56,7 @@ class RichTextFieldBlockFactory(FormFieldBlockFactory):
CustomFormFieldsFactory = wagtail_factories.StreamFieldFactory({
'title': TitleBlockFactory,
'email': EmailBlockFactory,
'full_name': FullNameBlockFactory,
'char': CharFieldBlockFactory,
......
......@@ -6,8 +6,9 @@ from .utils import send_activation_email
def convert_full_name_to_parts(defaults):
full_name = defaults.pop('full_name')
full_name = defaults.pop('full_name', ' ')
if not full_name:
# full_name was None
full_name = ' '
first_name, *last_name = full_name.split(' ')
if first_name:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment