Commit 2add58bb by Calen Pennington

Create sequences for names, emails, and usernames in UserFactory

parent ce2cbb74
...@@ -2,7 +2,7 @@ from student.models import (User, UserProfile, Registration, ...@@ -2,7 +2,7 @@ from student.models import (User, UserProfile, Registration,
CourseEnrollmentAllowed, CourseEnrollment) CourseEnrollmentAllowed, CourseEnrollment)
from django.contrib.auth.models import Group from django.contrib.auth.models import Group
from datetime import datetime from datetime import datetime
from factory import DjangoModelFactory, Factory, SubFactory, PostGenerationMethodCall, post_generation from factory import DjangoModelFactory, SubFactory, PostGenerationMethodCall, post_generation, Sequence
from uuid import uuid4 from uuid import uuid4
...@@ -33,11 +33,11 @@ class RegistrationFactory(DjangoModelFactory): ...@@ -33,11 +33,11 @@ class RegistrationFactory(DjangoModelFactory):
class UserFactory(DjangoModelFactory): class UserFactory(DjangoModelFactory):
FACTORY_FOR = User FACTORY_FOR = User
username = 'robot' username = Sequence('robot{0}'.format)
email = 'robot+test@edx.org' email = Sequence('robot+test+{0}@edx.org'.format)
password = PostGenerationMethodCall('set_password', password = PostGenerationMethodCall('set_password',
'test') 'test')
first_name = 'Robot' first_name = Sequence('Robot{0}'.format)
last_name = 'Test' last_name = 'Test'
is_staff = False is_staff = False
is_active = True is_active = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment