예제 #1
0
  def createAnotherOrgAdmin(self):
    """Create another organization administrator.
    """

    # create a second org admin role for the second org admin user
    oa_properties = {
        'link_id': 'another_org_admin',
        'scope_path': self.org.key().id_or_name(),
        'scope': self.org,
        'program': self.program,
        'user' : self.another_oa_user,
        'given_name': 'AnotherOrgAdmin',
        'surname': 'AnotherAdministrator',
        'name_on_documents': 'AnotherOrgAdmin Administrator',
        'birth_date': datetime.date(1975, 12, 15),
        'email': '*****@*****.**',
        'res_street': 'Another Org Admin Street',
        'res_city': 'Another Org Admin City',
        'res_state': 'Another Org Admin State',
        'res_country': 'Netherlands',
        'res_postalcode': '67890',
        'phone': '5-222-PURPLE',
        'agreed_to_tos': True,
        }
    # create the org_admin_entity
    self.another_oa = gsoc_oa_logic.updateOrCreateFromFields(
      oa_properties)
예제 #2
0
  def createOrgAdmin(self):
    """Create an organization administrator.
    """

    # create an org admin role for a user
    oa_properties = {
        'link_id': 'an_org_admin',
        'scope_path': self.org.key().id_or_name(),
        'scope': self.org,
        'program': self.program,
        'user' : self.oa_user,
        'given_name': 'OrgAdmin',
        'surname': 'Administrator',
        'name_on_documents': 'OrgAdmin Administrator',
        'birth_date': datetime.date(1970, 1, 1),
        'email': '*****@*****.**',
        'res_street': 'An Org Admin Street',
        'res_city': 'An Org Admin City',
        'res_state': 'An Org Admin State',
        'res_country': 'France',
        'res_postalcode': '12345',
        'phone': '1-555-BANANA',
        'agreed_to_tos': True,
        }
    # create the org_admin_entity
    self.oa = gsoc_oa_logic.updateOrCreateFromFields(
      oa_properties)
    self.scope_path = self.oa.scope_path
    self.link_id = self.oa.link_id
예제 #3
0
    def createAnotherOrgAdmin(self):
        """Create another organization administrator.
    """

        # create a second org admin role for the second org admin user
        oa_properties = {
            'link_id': 'another_org_admin',
            'scope_path': self.org.key().id_or_name(),
            'scope': self.org,
            'program': self.program,
            'user': self.another_oa_user,
            'given_name': 'AnotherOrgAdmin',
            'surname': 'AnotherAdministrator',
            'name_on_documents': 'AnotherOrgAdmin Administrator',
            'birth_date': datetime.date(1975, 12, 15),
            'email': '*****@*****.**',
            'res_street': 'Another Org Admin Street',
            'res_city': 'Another Org Admin City',
            'res_state': 'Another Org Admin State',
            'res_country': 'Netherlands',
            'res_postalcode': '67890',
            'phone': '5-222-PURPLE',
            'agreed_to_tos': True,
        }
        # create the org_admin_entity
        self.another_oa = gsoc_oa_logic.updateOrCreateFromFields(oa_properties)
예제 #4
0
    def createOrgAdmin(self):
        """Create an organization administrator.
    """

        # create an org admin role for a user
        oa_properties = {
            'link_id': 'an_org_admin',
            'scope_path': self.org.key().id_or_name(),
            'scope': self.org,
            'program': self.program,
            'user': self.oa_user,
            'given_name': 'OrgAdmin',
            'surname': 'Administrator',
            'name_on_documents': 'OrgAdmin Administrator',
            'birth_date': datetime.date(1970, 1, 1),
            'email': '*****@*****.**',
            'res_street': 'An Org Admin Street',
            'res_city': 'An Org Admin City',
            'res_state': 'An Org Admin State',
            'res_country': 'France',
            'res_postalcode': '12345',
            'phone': '1-555-BANANA',
            'agreed_to_tos': True,
        }
        # create the org_admin_entity
        self.oa = gsoc_oa_logic.updateOrCreateFromFields(oa_properties)
        self.scope_path = self.oa.scope_path
        self.link_id = self.oa.link_id
예제 #5
0
 def setUp(self):
     """Set up required for the view tests.
 """
     # Setup TaskQueueTestCase and MailTestCase first
     super(SurveysTasksTest, self).setUp()
     # Create a user for the founder of sponsor
     email = "*****@*****.**"
     account = users.User(email=email)
     link_id = 'a_sponsor_user'
     name = 'A Sponsor User'
     sponsor_user_properties = {
         'account': account,
         'link_id': link_id,
         'name': name,
     }
     sponsor_user = user_logic.updateOrCreateFromFields(
         sponsor_user_properties)
     # Create sponsor
     link_id = 'a_sponsor'
     name = 'A Sponsor'
     founder = 'a_founder'
     phone = '01234567'
     contact_postalcode = 'A postalcode'
     description = 'A description'
     contact_country = 'United States'
     short_name = 'AS'
     contact_city = 'A city'
     home_page = 'http://www.asponsor.com'
     email = '*****@*****.**'
     sponsor_properties = {
         'link_id': link_id,
         'name': name,
         'short_name': short_name,
         'founder': sponsor_user,
         'phone': phone,
         'description': description,
         'contact_country': contact_country,
         'contact_city': 'A City',
         'contact_street': 'A Street',
         'contact_postalcode': contact_postalcode,
         'home_page': home_page,
         'email': email,
         'status': 'active',
     }
     sponsor = sponsor_logic.updateOrCreateFromFields(sponsor_properties)
     # Create a timeline for a program
     timeline_properties = {
         'link_id': 'a_program',
         'scope_path': 'a_sponsor',
         'scope': sponsor,
     }
     timeline = timeline_logic.updateOrCreateFromFields(timeline_properties)
     # Create a program for a_sponsor
     program_properties = {
         'key_name': 'a_sponsor/a_program',
         'link_id': 'a_program',
         'scope': sponsor,
         'scope_path': 'a_sponsor',
         'name': 'A Program 2010',
         'short_name': 'AP2010',
         'group_label': 'AP',
         'description': 'This is the program for AP2010.',
         'apps_tasks_limit': 42,
         'slots': 42,
         'allocations_visible': True,
         'timeline': timeline,
         'status': 'visible',
     }
     # GSoC program logic does not work: error in updatePredefinedOrgTags
     from soc.modules.gsoc.models.program import GSoCProgram
     program = GSoCProgram(**program_properties)
     program.put()
     self.program = program
     # Create an organization for a_program
     organization_properties = {
         'link_id': 'an_org',
         'name': 'An Organization',
         'short_name': 'AO',
         'scope_path': 'a_sponsor/a_program',
         'scope': program,
         'founder': sponsor_user,
         'home_page': 'http://www.an_org.com',
         'phone': '1-555-2222',
         'description': 'An Organization',
         'license_name': 'Apache License',
         'ideas': 'http://www.an_org.com/ideas',
         'contact_country': contact_country,
         'contact_city': 'A City',
         'contact_street': 'A Street',
         'contact_postalcode': contact_postalcode,
         'home_page': home_page,
         'email': email,
         'status': 'active',
     }
     organization = gsoc_organization_logic.updateOrCreateFromFields(
         organization_properties)
     # Create a user for all roles except sponsor
     email = "*****@*****.**"
     account = users.User(email=email)
     link_id = 'a_role_user'
     name = 'A Role User'
     properties = {
         'account': account,
         'link_id': link_id,
         'name': name,
     }
     key_name = user_logic.getKeyNameFromFields(properties)
     role_user = user_logic.updateOrCreateFromKeyName(properties, key_name)
     # Create an admin for an_org
     gsoc_org_admin_properties = {
         'link_id': 'an_org_admin',
         'given_name': 'A',
         'surname': 'Orgadmin',
         'scope_path': organization.scope_path + '/' + organization.link_id,
         'scope': organization,
         'program': program,
         'phone': '1-555-2222',
         'email': '*****@*****.**',
         'res_country': 'United States',
         'res_city': 'A City',
         'res_street': 'A Street',
         'res_postalcode': '12345',
         'birth_date': db.DateProperty.now(),
         'user': role_user,
     }
     gsoc_org_admin_logic.updateOrCreateFromFields(
         gsoc_org_admin_properties)
     # Create a mentor for an_org
     mentor_properties = gsoc_org_admin_properties.copy()
     mentor_properties.update({
         'link_id': 'a_mentor',
         'given_name': 'A',
         'surname': 'Mentor',
         'email': '*****@*****.**',
     })
     mentor = mentor_logic.updateOrCreateFromFields(mentor_properties)
     self.mentor = mentor
     # Create students for a_program
     student_properties = gsoc_org_admin_properties.copy()
     student_properties.update({
         'scope_path':
         program.scope_path + '/' + program.link_id,
         'scope':
         program,
         'program':
         program,
         'given_name':
         'A',
         'surname':
         'Student',
         'major':
         'A Major',
         'name_on_documents':
         'A Name on Documents',
         'publish_location':
         True,
         'blog':
         'http://www.ablog.com/',
         'home_page':
         'http://www.ahomepage.com/',
         'photo_url':
         'http://www.astudent.com/aphoto.png',
         'expected_graduation':
         2011,
         'school_country':
         'United States',
         'school_name':
         'A School',
         'tshirt_size':
         'XS',
         'tshirt_style':
         'male',
         'degree':
         'Undergraduate',
         'phone':
         '1650253000',
         'can_we_contact_you':
         True,
         'program_knowledge':
         'I heard about this program through a friend.'
     })
     # Create projects for a_program, an_org and a_mentor
     project_properties = {
         'scope_path': organization.scope_path + '/' + organization.link_id,
         'scope': organization,
         'title': 'test project',
         'abstract': 'test abstract',
         'status': 'accepted',
         'mentor': mentor,
         'program': program,
     }
     #The string order of students' link_id is the same with that of students
     #in the array in order to make sure the last student is handled last
     size = 10
     self.num_projects = size + 1
     num_digits = 0
     while True:
         size /= 10
         num_digits += 1
         if size == 0:
             break
     students, projects = [], []
     for i in xrange(self.num_projects):
         student_link_id = ('student%0' + str(num_digits) + 'd') % i
         student_properties.update({
             'link_id': student_link_id,
             'email': student_link_id + '@email.com',
         })
         student = student_logic.updateOrCreateFromFields(
             student_properties)
         students.append(student)
         project_link_id = ('project%0' + str(num_digits) + 'd') % i
         project_properties.update({
             'link_id': project_link_id,
             'student': student,
         })
         project = student_project_logic.updateOrCreateFromFields(
             project_properties)
         projects.append(project)
     self.students = students
     self.projects = projects
     # Create a project survey for a_program
     link_id = 'a_project_survey'
     fields = {
         'SelectionQ': [
             u'SelectionQ Option 2 for %s' % link_id,
             u'SelectionQ Option 1 for %s' % link_id
         ],
         'PickMultipleQ': [
             'PickMultipleQ Checkbox 1 for %s' % link_id,
             'PickMultipleQ Checkbox 2 for %s' % link_id,
         ],
         'LongQ':
         'LongQ Custom Prompt for %s' % link_id,
         'ShortQ':
         'ShortQ Custom Prompt for %s' % link_id,
     }
     schema = {
         u'PickMultipleQ': {
             'index': 5,
             'type': 'pick_multi',
             'render': 'multi_checkbox'
         },
         u'LongQ': {
             'index': 2,
             'type': 'long_answer'
         },
         u'ShortQ': {
             'index': 3,
             'type': 'short_answer'
         },
         u'SelectionQ': {
             'index': 4,
             'type': 'selection',
             'render': 'single_select'
         }
     }
     survey_properties = {
         'link_id': link_id,
         'scope_path': program.scope_path + '/' + program.link_id,
         'scope': None,
         'prefix': 'program',
         'author': role_user,
         'title': 'A Project Survey',
         'short_name': 'APS',
         'modified_by': role_user,
         'is_featured': True,
         'fields': fields,
         'schema': schema,
         'deadline': datetime.datetime.now() + datetime.timedelta(10),
         'taking_access': 'student',
     }
     project_survey = project_survey_logic.updateOrCreateFromFields(
         survey_properties)
     self.project_survey = project_survey
     # Create a grading survey for a_program
     link_id = 'a_grading_survey'
     survey_properties.update({
         'link_id': link_id,
         'title': 'A Grading Survey',
         'short_name': 'AGS',
         'taking_access': 'mentor',
     })
     grading_survey = grading_survey_logic.updateOrCreateFromFields(
         survey_properties)
     self.grading_survey = grading_survey
 def setUp(self):
   """Set up required for the view tests.
   """
   # Setup TaskQueueTestCase and MailTestCase first
   super(GradingSurveyGroupTasksTest, self).setUp()
   # Create a user for the founder of sponsor
   email = "*****@*****.**"
   account = users.User(email=email)
   link_id = 'a_sponsor_user'
   name = 'A Sponsor User'
   sponsor_user_properties = {
       'account': account,
       'link_id': link_id,
       'name': name,
       }
   sponsor_user = user_logic.updateOrCreateFromFields(sponsor_user_properties)
   # Create sponsor
   link_id = 'a_sponsor'
   name = 'A Sponsor'
   founder = 'a_founder'
   phone = '01234567'
   contact_postalcode = 'A postalcode'
   description = 'A description'
   contact_country = 'United States'
   short_name = 'AS'
   contact_city = 'A city'
   home_page = 'http://www.asponsor.com'
   email = '*****@*****.**'
   sponsor_properties = {
       'link_id': link_id,
       'name': name,
       'short_name': short_name,
       'founder': sponsor_user,
       'phone': phone,
       'description': description,
       'contact_country': contact_country,
      'contact_city': 'A City',
      'contact_street': 'A Street',
       'contact_postalcode': contact_postalcode,
       'home_page': home_page,
       'email': email,
       'status': 'active',
       }
   sponsor = sponsor_logic.updateOrCreateFromFields(sponsor_properties)
   # Create a timeline for a program
   timeline_properties = {
       'link_id': 'a_program',
       'scope_path': 'a_sponsor',
       'scope': sponsor,
         }
   timeline = timeline_logic.updateOrCreateFromFields(timeline_properties)
   # Create a program for a_sponsor
   program_properties = {
       'key_name': 'a_sponsor/a_program',
       'link_id': 'a_program',
       'scope': sponsor,
       'scope_path': 'a_sponsor',
       'name': 'A Program 2010',
       'short_name': 'AP2010',
       'group_label': 'AP',
       'description': 'This is the program for AP2010.',
       'apps_tasks_limit': 42,
       'slots': 42,
       'allocations_visible': True,
       'timeline': timeline,
       'status': 'visible',
       }
   # GSoC program logic does not work: error in updatePredefinedOrgTags
   from soc.modules.gsoc.models.program import GSoCProgram
   program = GSoCProgram(**program_properties)
   program.put()
   self.program = program
   # Create an organization for a_program
   organization_properties = {
     'link_id': 'an_org',
     'name': 'An Organization',
     'short_name': 'AO',
     'scope_path': 'a_sponsor/a_program',
     'scope': program,
     'founder': sponsor_user,
     'home_page': 'http://www.an_org.com',
     'phone': '1-555-2222',
     'description': 'An Organization',
     'license_name': 'Apache License',
     'ideas': 'http://www.an_org.com/ideas',
       'contact_country': contact_country,
      'contact_city': 'A City',
      'contact_street': 'A Street',
       'contact_postalcode': contact_postalcode,
       'home_page': home_page,
       'email': email,
       'status': 'active',
     }
   organization = gsoc_organization_logic.updateOrCreateFromFields(
       organization_properties)
   # Create a user for all roles except sponsor
   email = "*****@*****.**"
   account = users.User(email=email)
   link_id = 'a_role_user'
   name = 'A Role User'
   properties = {
       'account': account,
       'link_id': link_id,
       'name': name,
       }
   key_name = user_logic.getKeyNameFromFields(properties)
   role_user = user_logic.updateOrCreateFromKeyName(properties, key_name)
   # Create an admin for an_org
   gsoc_org_admin_properties = {
     'link_id': 'an_org_admin',
     'given_name': 'A',
     'surname': 'Orgadmin',
     'scope_path': organization.scope_path + '/' + organization.link_id,
     'scope': organization,
     'program': program,
     'phone': '1-555-2222',
     'email': '*****@*****.**',
     'res_country': 'United States',
     'res_city': 'A City',
     'res_street': 'A Street',
     'res_postalcode': '12345',
     'birth_date': db.DateProperty.now(),
     'user': role_user,
     }
   gsoc_org_admin_logic.updateOrCreateFromFields(gsoc_org_admin_properties)
   # Create a mentor for an_org
   mentor_properties = gsoc_org_admin_properties.copy()
   mentor_properties.update({
       'link_id': 'a_mentor',
       'given_name': 'A',
       'surname': 'Mentor',
     'email': '*****@*****.**',
       })
   mentor = mentor_logic.updateOrCreateFromFields(mentor_properties)
   self.mentor = mentor
   # Create students for a_program
   student_properties = gsoc_org_admin_properties.copy()
   student_properties.update({
       'scope_path': program.scope_path + '/' + program.link_id,
       'scope': program,
       'program': program,
       'given_name': 'A',
       'surname': 'Student',
       'major': 'A Major',
       'name_on_documents': 'A Name on Documents',
       'publish_location': True,
       'blog': 'http://www.ablog.com/',
       'home_page': 'http://www.ahomepage.com/',
       'photo_url': 'http://www.astudent.com/aphoto.png',
       'expected_graduation': 2011,
       'school_country': 'United States',
       'school_name': 'A School',
       'tshirt_size': 'XS',
       'tshirt_style': 'male',
       'degree': 'Undergraduate',
       'phone': '1650253000',
       'can_we_contact_you': True,
       'program_knowledge': 'I heard about this program through a friend.'
       })
   # Create projects for a_program, an_org and a_mentor
   project_properties = {
       'scope_path': organization.scope_path + '/' + organization.link_id,
       'scope': organization,
       'title': 'test project',
       'abstract': 'test abstract',
       'status': 'accepted',
       'mentor': mentor,
       'program': program,
        }
   #The string order of students' link_id is the same with that of students
   #in the array in order to make sure the last student is handled last
   size = DEF_BATCH_SIZE
   num_digits = 0
   while True:
     size /= 10
     num_digits += 1
     if size == 0:
       break
   students, projects = [], []
   for i in xrange(DEF_BATCH_SIZE+1):
     student_link_id = ('student%0'+str(num_digits)+'d') % i
     student_properties.update({
         'link_id': student_link_id,
         'email': student_link_id + '@email.com',
         })
     student = student_logic.updateOrCreateFromFields(student_properties)
     students.append(student)
     project_link_id = ('project%0'+str(num_digits)+'d') % i
     project_properties.update({
         'link_id': project_link_id,
         'student': student,
         })
     project = student_project_logic.updateOrCreateFromFields(
         project_properties)
     projects.append(project)
   self.students = students
   self.projects = projects
   # Create a project survey for a_program
   link_id = 'a_project_survey'
   fields = {'SelectionQ': [u'SelectionQ Option 2 for %s' % link_id,
                            u'SelectionQ Option 1 for %s'  % link_id
                            ],
             'PickMultipleQ': ['PickMultipleQ Checkbox 1 for %s' % link_id,
                               'PickMultipleQ Checkbox 2 for %s' % link_id,
                               ],
             'LongQ': 'LongQ Custom Prompt for %s' % link_id,
             'ShortQ': 'ShortQ Custom Prompt for %s' % link_id,
             }
   schema = {u'PickMultipleQ': {'index': 5, 'type': 'pick_multi',
                                'render': 'multi_checkbox'},
             u'LongQ': {'index': 2, 'type': 'long_answer'},
             u'ShortQ': {'index': 3, 'type': 'short_answer'},
             u'SelectionQ': {'index': 4, 'type': 'selection',
                             'render': 'single_select'}
             }
   survey_properties = {
       'link_id': link_id,
       'scope_path': program.scope_path + '/' + program.link_id,
       'scope': None,
       'prefix': 'program',
       'author': role_user,
       'title': 'A Project Survey',
       'short_name': 'APS',
       'modified_by': role_user,
       'is_featured': True,
       'fields': fields,
       'schema': schema,
       'deadline': datetime.datetime.now() + datetime.timedelta(10),
       'taking_access': 'student',
       }
   project_survey = project_survey_logic.updateOrCreateFromFields(
       survey_properties)
   self.project_survey = project_survey
   # Create a grading survey for a_program
   link_id = 'a_grading_survey'
   survey_properties.update({
       'link_id': link_id,
       'title': 'A Grading Survey',
       'short_name': 'AGS',
       'taking_access': 'mentor',
       })
   grading_survey = grading_survey_logic.updateOrCreateFromFields(
       survey_properties)
   self.grading_survey = grading_survey
   # Create a survey group for a_grading_survey and a_project_survey
   # of a_program
   survey_group_properties = {
       'link_id': link_id,
       'scope_path': program.scope_path + '/' + program.link_id,
       'scope': program,
       'name': 'A Survey Group',
       'grading_survey': grading_survey,
       'student_survey': project_survey,
       }
   survey_group = survey_group_logic.updateOrCreateFromFields(
       survey_group_properties)
   self.survey_group = survey_group
예제 #7
0
  def createOrgAdminUserForAnotherOrg(self, with_oa_entity=False):
    """Create another organization, user and invitation for the user
    """

    # Create a user for org admin who is also the founder of the another_org
    email = '*****@*****.**'
    account = users.User(email=email)
    link_id = 'another_org_oa_user'
    name = 'Another Org Org Admin User'
    oa_user_properties = {
        'account': account,
        'link_id': link_id,
        'name': name,
        'agreed_to_tos': True,
        }
    self.another_org_oa_user = user_logic.updateOrCreateFromFields(
        oa_user_properties)

    # create another org for the program
    org_properties = {
        'link_id': 'another_org',
        'scope': self.program,
        'scope_path': self.program.key().id_or_name(),
        'name': 'Another Organization',
        'short_name': 'Another Org' ,
        'founder': self.another_org_oa_user,
        'home_page': 'http://anotherorg.com',
        'email': '*****@*****.**',
        'description': 'Another Organization Description',
        'contact_street': 'Another Organization Street',
        'contact_city': 'Another Organization City',
        'contact_country': 'Sweden',
        'contact_postalcode': '5653276 NG',
        'phone': '61-434-BLUE',
        'status': 'active',
        }
    self.another_org = org_logic.updateOrCreateFromFields(org_properties)

    request_properties = {
        'role': 'gsoc_org_admin',
        'user': self.another_org_oa_user,
        'group': self.another_org,
        'message': 'An Invitation Request Message',
        'status': 'group_accepted',
        }
    self.another_org_request = request_logic.updateOrCreateFromFields(
        request_properties)

    if with_oa_entity:
      # create a second org admin role for the second org admin user
      oa_properties = {
          'link_id': 'another_org_org_admin',
          'scope_path': self.another_org.key().id_or_name(),
          'scope': self.another_org,
          'program': self.program,
          'user' : self.another_org_oa_user,
          'given_name': 'AnotherOrgOrgAdmin',
          'surname': 'AnotherOrgAdministrator',
          'name_on_documents': 'AnotherOrgOrgAdmin Administrator',
          'birth_date': datetime.date(1975, 12, 15),
          'email': '*****@*****.**',
          'res_street': 'Another Org Admin Street',
          'res_city': 'Another Org Admin City',
          'res_state': 'Another Org Admin State',
          'res_country': 'Netherlands',
          'res_postalcode': '572461',
          'phone': '72-534-COLORLESS',
          'agreed_to_tos': True,
          }
      # create the org_admin_entity
      self.another_org_oa = gsoc_oa_logic.updateOrCreateFromFields(
        oa_properties)

      # Create an user for second org admin for another org
      email = '*****@*****.**'
      account = users.User(email=email)
      link_id = 'another_org_another_oa_user'
      name = 'Another Org Admin User'
      oa_user_properties = {
          'account': account,
          'link_id': link_id,
          'name': name,
          'agreed_to_tos': True,
          }
      self.another_org_oa_user = user_logic.updateOrCreateFromFields(
          oa_user_properties)

      request_properties = {
          'role': 'gsoc_org_admin',
          'user': self.another_org_oa_user,
          'group': self.another_org,
          'message': 'An Invitation Request Message',
          'status': 'group_accepted',
          }
      self.another_org_second_request = request_logic.updateOrCreateFromFields(
          request_properties)
예제 #8
0
    def createOrgAdminUserForAnotherOrg(self, with_oa_entity=False):
        """Create another organization, user and invitation for the user
    """

        # Create a user for org admin who is also the founder of the another_org
        email = '*****@*****.**'
        account = users.User(email=email)
        link_id = 'another_org_oa_user'
        name = 'Another Org Org Admin User'
        oa_user_properties = {
            'account': account,
            'link_id': link_id,
            'name': name,
            'agreed_to_tos': True,
        }
        self.another_org_oa_user = user_logic.updateOrCreateFromFields(
            oa_user_properties)

        # create another org for the program
        org_properties = {
            'link_id': 'another_org',
            'scope': self.program,
            'scope_path': self.program.key().id_or_name(),
            'name': 'Another Organization',
            'short_name': 'Another Org',
            'founder': self.another_org_oa_user,
            'home_page': 'http://anotherorg.com',
            'email': '*****@*****.**',
            'description': 'Another Organization Description',
            'contact_street': 'Another Organization Street',
            'contact_city': 'Another Organization City',
            'contact_country': 'Sweden',
            'contact_postalcode': '5653276 NG',
            'phone': '61-434-BLUE',
            'status': 'active',
        }
        self.another_org = org_logic.updateOrCreateFromFields(org_properties)

        request_properties = {
            'role': 'gsoc_org_admin',
            'user': self.another_org_oa_user,
            'group': self.another_org,
            'message': 'An Invitation Request Message',
            'status': 'group_accepted',
        }
        self.another_org_request = request_logic.updateOrCreateFromFields(
            request_properties)

        if with_oa_entity:
            # create a second org admin role for the second org admin user
            oa_properties = {
                'link_id': 'another_org_org_admin',
                'scope_path': self.another_org.key().id_or_name(),
                'scope': self.another_org,
                'program': self.program,
                'user': self.another_org_oa_user,
                'given_name': 'AnotherOrgOrgAdmin',
                'surname': 'AnotherOrgAdministrator',
                'name_on_documents': 'AnotherOrgOrgAdmin Administrator',
                'birth_date': datetime.date(1975, 12, 15),
                'email': '*****@*****.**',
                'res_street': 'Another Org Admin Street',
                'res_city': 'Another Org Admin City',
                'res_state': 'Another Org Admin State',
                'res_country': 'Netherlands',
                'res_postalcode': '572461',
                'phone': '72-534-COLORLESS',
                'agreed_to_tos': True,
            }
            # create the org_admin_entity
            self.another_org_oa = gsoc_oa_logic.updateOrCreateFromFields(
                oa_properties)

            # Create an user for second org admin for another org
            email = '*****@*****.**'
            account = users.User(email=email)
            link_id = 'another_org_another_oa_user'
            name = 'Another Org Admin User'
            oa_user_properties = {
                'account': account,
                'link_id': link_id,
                'name': name,
                'agreed_to_tos': True,
            }
            self.another_org_oa_user = user_logic.updateOrCreateFromFields(
                oa_user_properties)

            request_properties = {
                'role': 'gsoc_org_admin',
                'user': self.another_org_oa_user,
                'group': self.another_org,
                'message': 'An Invitation Request Message',
                'status': 'group_accepted',
            }
            self.another_org_second_request = request_logic.updateOrCreateFromFields(
                request_properties)