Fix unit test
This commit is contained in:
parent
f9e7534fff
commit
75ca2f552c
|
|
@ -56,7 +56,11 @@ def create_users(data=None):
|
|||
hep_id = 1
|
||||
|
||||
for school_class in data:
|
||||
first, last, avatar_url = school_class.get('teacher')
|
||||
try:
|
||||
first, last, avatar_url = school_class.get('teacher')
|
||||
except ValueError:
|
||||
first, last = school_class.get('teacher')
|
||||
avatar_url = ''
|
||||
teacher = UserFactory(
|
||||
username='{}.{}'.format(first, last).lower(),
|
||||
first_name=first,
|
||||
|
|
@ -71,7 +75,12 @@ def create_users(data=None):
|
|||
|
||||
students = []
|
||||
|
||||
for first, last in school_class.get('students'):
|
||||
for student_data in school_class.get('students'):
|
||||
try:
|
||||
first, last, avatar_url = student_data
|
||||
except ValueError:
|
||||
first, last = student_data
|
||||
avatar_url = ''
|
||||
hep_id += 1
|
||||
student = create_student(
|
||||
username='{}.{}'.format(first, last).lower(),
|
||||
|
|
@ -80,7 +89,8 @@ def create_users(data=None):
|
|||
email='{}.{}@skillbox.example'.format(first, last).lower(),
|
||||
onboarding_visited=True,
|
||||
license_expiry_date=in_a_week,
|
||||
hep_id=hep_id
|
||||
hep_id=hep_id,
|
||||
avatar_url=avatar_url
|
||||
)
|
||||
|
||||
students.append(student)
|
||||
|
|
|
|||
Loading…
Reference in New Issue