def test_powerview_update(self):
'''Updating with valid data_dict.'''
sysadmin = Sysadmin()
powerview_dict_create = factories.PowerView()
powerview_dict_update = toolkit.get_action('powerview_update')(
context={'user': sysadmin['name']},
data_dict=powerview_dict_create.copy()
)
# last_modified has changed
nosetools.assert_true(powerview_dict_create['last_modified'] is None)
nosetools.assert_true(powerview_dict_update['last_modified']
is not None)
# but it should be the only thing that changed
powerview_dict_update['last_modified'] = None
nosetools.assert_equal(powerview_dict_create, powerview_dict_update)
评论列表
文章目录