1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2026-08-02 02:18:37 +02:00

More tests on LeObject

This commit is contained in:
Yann 2016-06-10 16:30:13 +02:00
commit 0b60023145
4 changed files with 12 additions and 4 deletions

View file

@ -106,6 +106,8 @@ person.new_field( 'alias',
},
data_handler = 'set',
allowed_classes = [person],
default = None,
nullable = True,
)
@ -272,7 +274,9 @@ person.new_field( 'linked_texts',
data_handler = 'list',
back_reference = ('Text', 'linked_persons'),
group = editorial_person_group,
allowed_classes = [text])
allowed_classes = [text],
default = None,
nullable = True)
text.new_field( 'linked_persons',
display_name = {

Binary file not shown.

Binary file not shown.

View file

@ -55,9 +55,13 @@ class LeFilteredQueryTestCase(unittest.TestCase):
def test_insert(self):
dyncode.Person.insert({'lastname': 'foo', 'firstname': 'bar'})
@unittest.skip("wait")
def test_bad_insert(self):
""" Insert with bad arguments """
dyncode.Person.insert({})
dyncode.Person.insert({'lodel_id': 1,'lastname': 'foo', 'firstname': 'bar'})
badargs = [
{},
{'lodel_id': 1,'lastname': 'foo', 'firstname': 'bar'}]
for arg in badargs:
with self.assertRaises(LeApiDataCheckErrors):
dyncode.Person.insert(arg)