def setUp(self): super(OrganizationsApiTests, self).setUp() self.test_server_prefix = 'https://testserver' self.base_organizations_uri = '/api/server/organizations/' self.base_users_uri = '/api/server/users' self.base_groups_uri = '/api/server/groups' self.test_organization_name = str(uuid.uuid4()) self.test_organization_display_name = 'Test Org' self.test_organization_contact_name = 'John Org' self.test_organization_contact_email = '*****@*****.**' self.test_organization_contact_phone = '+1 332 232 24234' self.test_organization_logo_url = 'org_logo.jpg' self.test_user_email = str(uuid.uuid4()) self.test_user_username = str(uuid.uuid4()) self.test_user = User.objects.create(email=self.test_user_email, username=self.test_user_username) profile = UserProfile(user=self.test_user) profile.city = 'Boston' profile.save() self.test_user2 = User.objects.create(email=str(uuid.uuid4()), username=str(uuid.uuid4())) profile2 = UserProfile(user=self.test_user2) profile2.city = 'NYC' profile2.save() self.course = CourseFactory.create() self.second_course = CourseFactory.create(number="899") cache.clear()
def setUp(self): self.test_server_prefix = 'https://testserver' self.base_organizations_uri = '/api/server/organizations/' self.base_users_uri = '/api/server/users' self.base_groups_uri = '/api/server/groups' self.test_organization_name = str(uuid.uuid4()) self.test_organization_display_name = 'Test Org' self.test_organization_contact_name = 'John Org' self.test_organization_contact_email = '*****@*****.**' self.test_organization_contact_phone = '+1 332 232 24234' self.test_user_email = str(uuid.uuid4()) self.test_user_username = str(uuid.uuid4()) self.test_user = User.objects.create( email=self.test_user_email, username=self.test_user_username ) profile = UserProfile(user=self.test_user) profile.city = 'Boston' profile.save() self.course = CourseFactory.create() self.second_course = CourseFactory.create( number="899" ) self.client = SecureClient() cache.clear()
def setUp(self): # pylint: disable=E7601 """ Create one user and save it to the database """ self.user = UserFactory.build(username='******', email='*****@*****.**') self.user.set_password('test_password') self.user.save() profile = UserProfile(user=self.user) profile.city = 'Boston' profile.save() # Create the test client cache.clear() self.session_url = '/api/server/sessions'
def setUp(self): """ Create one user and save it to the database """ self.user = UserFactory.build(username='******', email='*****@*****.**') self.user.set_password('test_password') self.user.save() profile = UserProfile(user=self.user) profile.city = 'Boston' profile.save() # Create the test client self.client = Client() cache.clear() self.session_url = '/api/server/sessions'