'Test setting of values in one-one fields'

def test_one_one(self):

    tests = [self.create_test(u'#yesno', (True, False, u'true', u'false', None))]
    for (name, getter, setter) in ((u'#series_index', None, None), (u'series_index', u'series_index', u'set_series_index'), (u'#float', None, None)):
        vals = [u'1.5', None, 0, 1.0]
        tests.append(self.create_test(name, tuple(vals), getter, setter))
    for (name, getter, setter) in ((u'pubdate', u'pubdate', u'set_pubdate'), (u'timestamp', u'timestamp', u'set_timestamp'), (u'#date', None, None)):
        tests.append(self.create_test(name, (u'2011-1-12', UNDEFINED_DATE, None), getter, setter))
    for (name, getter, setter) in ((u'title', u'title', u'set_title'), (u'uuid', u'uuid', u'set_uuid'), (u'author_sort', u'author_sort', u'set_author_sort'), (u'sort', u'title_sort', u'set_title_sort'), (u'#comments', None, None), (u'comments', u'comments', u'set_comment')):
        vals = [u'something', None]
        if (name not in {u'comments', u'#comments'}):
            vals.append(u'')
        if (name == u'comments'):
            vals.remove(None)
        tests.append(self.create_test(name, tuple(vals), getter, setter))
    self.run_tests(tests)
