Fixed a test email object creation issue.

- Legacy-Id: 15180
This commit is contained in:
Henrik Levkowetz 2018-05-28 09:48:27 +00:00
parent 08c137c960
commit 46bee81bdc

View file

@ -123,7 +123,9 @@ def nomcom_test_data():
u.set_password(COMMUNITY_USER+"+password")
u.save()
plainman, _ = Person.objects.get_or_create(name="Plain Man", ascii="Plain Man", user=u)
email, _ = Email.objects.get_or_create(address="plain@example.com", person=plainman, origin='test')
email = Email.objects.filter(address="plain@example.com", person=plainman).first()
if not email:
email = Email.objects.create(address="plain@example.com", person=plainman, origin=u.username)
nominee, _ = Nominee.objects.get_or_create(email=email, nomcom=nomcom)
# positions