Example #1
0
 def testForExistingConnection(self, mock_func):
   """Tests that a non-student profile with connection cannot create one."""
   result = connection_logic.canCreateConnection(self.profile, self.org.key)
   self.assertFalse(result)
   self.assertEqual(
       result.extra, connection_logic._CONNECTION_EXISTS % (
           self.profile.profile_id, self.org.key.id()))
Example #2
0
 def testForExistingConnection(self, mock_func):
     """Tests that a non-student profile with connection cannot create one."""
     result = connection_logic.canCreateConnection(self.profile,
                                                   self.org.key)
     self.assertFalse(result)
     self.assertEqual(
         result.extra, connection_logic._CONNECTION_EXISTS %
         (self.profile.profile_id, self.org.key.id()))
Example #3
0
  def testForStudent(self):
    """Tests that a student profile cannot create a connection."""
    # make the profile a student
    self.profile.student_data = profile_utils.seedStudentData()

    result = connection_logic.canCreateConnection(self.profile, self.org.key)
    self.assertFalse(result)
    self.assertEqual(
        result.extra,
        connection_logic._PROFILE_IS_STUDENT % self.profile.profile_id)
Example #4
0
    def testForStudent(self):
        """Tests that a student profile cannot create a connection."""
        # make the profile a student
        self.profile.student_data = profile_utils.seedStudentData()

        result = connection_logic.canCreateConnection(self.profile,
                                                      self.org.key)
        self.assertFalse(result)
        self.assertEqual(
            result.extra,
            connection_logic._PROFILE_IS_STUDENT % self.profile.profile_id)
Example #5
0
 def testForNonExistingConnection(self):
     """Tests that a non-student profile with no connection can create one."""
     result = connection_logic.canCreateConnection(self.profile,
                                                   self.org.key)
     self.assertTrue(result)
Example #6
0
 def testForNonExistingConnection(self):
   """Tests that a non-student profile with no connection can create one."""
   result = connection_logic.canCreateConnection(self.profile, self.org.key)
   self.assertTrue(result)