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()))
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()))
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)
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)