'Test: create/edit a profile object'

def _create_profile(self):

    profiles = self.remote.get_profiles(self.token)
    tprint('new_profile')
    profile = self.remote.new_profile(self.token)
    tprint('modify_profile')
    for field in self.profile_fields:
        (fname, fgood, fbad) = field
        for fb in fbad:
            try:
                self.remote.modify_profile(profile, fname, fb, self.token)
            except:
                pass
            else:
                self.fail(('bad    field    (%s=%s)    did    not    raise    an    exception' % (fname, fb)))
        for fg in fgood:
            try:
                self.assertTrue(self.remote.modify_profile(profile, fname, fg, self.token))
            except Exception as e:
                self.fail(('good    field    (%s=%s)    raised    exception:    %s' % (fname, fg, str(e))))
    tprint('save_profile')
    self.assertTrue(self.remote.save_profile(profile, self.token))
    new_profiles = self.remote.get_profiles(self.token)
    self.assertTrue((len(new_profiles) == (len(profiles) + 1)))
