Skip to content
Snippets Groups Projects
Commit 0d3e7776 authored by robinwilliam.hundt's avatar robinwilliam.hundt
Browse files

passowrd is now set when specified in dictionary

parent b93c2b45
No related branches found
No related tags found
1 merge request!31Password is now set when specified in dictionary
Pipeline #
......@@ -62,8 +62,10 @@ class GradyUserFactory:
username=username,
defaults=kwargs)
if created:
password = self.password_generator_func() if password is None else password
if created or password is not None:
password = self.password_generator_func() if password is None \
else password
print(password)
user.set_password(password)
user.save()
......@@ -129,7 +131,8 @@ def make_submission_types(submission_types=[], **kwargs):
def make_students(students=[], **kwargs):
return [GradyUserFactory().make_student(
username=student['username'],
exam=ExamType.objects.get(module_reference=student['exam'])
exam=ExamType.objects.get(module_reference=student['exam']),
password=student.get('password', None)
) for student in students]
......@@ -216,6 +219,7 @@ def init_test_instance():
'students': [{
'username': 'student01',
'exam': 'Test Exam 01',
'password': 'p'
}],
'tutors': [{
'username': 'tutor01'
......
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