Exemplo n.º 1
0
 def test_serialize_simple_user(self):
     user = UserFactory()
     info = serialize_simple_user((user._id, 'admin'))
     assert_is_instance(info, dict)
     assert_equal(info['id'], user._id)
     assert_equal(info['name'], user.fullname)
     assert_equal(info['permission'], 'admin')
Exemplo n.º 2
0
 def get_context_data(self, **kwargs):
     context = {}
     node, user = kwargs.get('object')
     context.setdefault('node_id', node.pk)
     context.setdefault('user', serialize_simple_user((user.pk, None)))
     return super(NodeRemoveContributorView,
                  self).get_context_data(**context)
Exemplo n.º 3
0
 def get_context_data(self, **kwargs):
     context = {}
     node, user = kwargs.get("object")
     context.setdefault("node_id", node.pk)
     context.setdefault("user", serialize_simple_user((user.pk, None)))
     return super(NodeRemoveContributorView, self).get_context_data(**context)