Made all unit tests pass
This commit is contained in:
parent
844b04adbb
commit
aa48593a40
10 changed files with 148 additions and 110 deletions
|
|
@ -258,12 +258,12 @@ def prototype_from_object(obj):
|
|||
aliases = obj.aliases.get(return_list=True)
|
||||
if aliases:
|
||||
prot['aliases'] = aliases
|
||||
tags = [(tag.db_key, tag.db_category, tag.db_data)
|
||||
for tag in obj.tags.all(return_objs=True)]
|
||||
tags = sorted([(tag.db_key, tag.db_category, tag.db_data)
|
||||
for tag in obj.tags.all(return_objs=True)])
|
||||
if tags:
|
||||
prot['tags'] = tags
|
||||
attrs = [(attr.key, attr.value, attr.category, ';'.join(attr.locks.all()))
|
||||
for attr in obj.attributes.all()]
|
||||
attrs = sorted([(attr.key, attr.value, attr.category, ';'.join(attr.locks.all()))
|
||||
for attr in obj.attributes.all()])
|
||||
if attrs:
|
||||
prot['attrs'] = attrs
|
||||
|
||||
|
|
|
|||
|
|
@ -122,9 +122,9 @@ class TestUtils(EvenniaTest):
|
|||
|
||||
self.assertEqual(obj_prototype,
|
||||
{'aliases': ['foo'],
|
||||
'attrs': [('oldtest', 'to_keep', None, ''),
|
||||
('test', 'testval', None, ''),
|
||||
('desc', 'changed desc', None, '')],
|
||||
'attrs': [('desc', 'changed desc', None, ''),
|
||||
('oldtest', 'to_keep', None, ''),
|
||||
('test', 'testval', None, '')],
|
||||
'key': 'Obj',
|
||||
'home': '#1',
|
||||
'location': '#1',
|
||||
|
|
@ -213,9 +213,9 @@ class TestUtils(EvenniaTest):
|
|||
self.assertEqual(count, 1)
|
||||
|
||||
new_prot = spawner.prototype_from_object(self.obj1)
|
||||
self.assertEqual({'attrs': [('oldtest', 'to_keep', None, ''),
|
||||
('fooattr', 'fooattrval', None, ''),
|
||||
self.assertEqual({'attrs': [('fooattr', 'fooattrval', None, ''),
|
||||
('new', 'new_val', None, ''),
|
||||
('oldtest', 'to_keep', None, ''),
|
||||
('test', 'testval_changed', None, '')],
|
||||
'home': Something,
|
||||
'key': 'Obj',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue