Ejemplo n.º 1
0
    def test_render_node_returns_permissions(self):
        node = ProjectFactory()
        admin = UserFactory()
        node.add_contributor(admin, auth=Auth(node.creator),
            permissions=permissions.expand_permissions(permissions.ADMIN))
        writer = UserFactory()
        node.add_contributor(writer, auth=Auth(node.creator),
            permissions=permissions.expand_permissions(permissions.WRITE))
        node.save()

        res_admin = _render_node(node, Auth(admin))
        assert_equal(res_admin['permissions'], 'admin')
        res_writer = _render_node(node, Auth(writer))
        assert_equal(res_writer['permissions'], 'write')
Ejemplo n.º 2
0
    def test_render_node_returns_permissions(self):
        node = ProjectFactory()
        admin = UserFactory()
        node.add_contributor(admin, auth=Auth(node.creator),
            permissions=permissions.expand_permissions(permissions.ADMIN))
        writer = UserFactory()
        node.add_contributor(writer, auth=Auth(node.creator),
            permissions=permissions.expand_permissions(permissions.WRITE))
        node.save()

        res_admin = _render_node(node, Auth(admin))
        assert_equal(res_admin['permissions'], 'admin')
        res_writer = _render_node(node, Auth(writer))
        assert_equal(res_writer['permissions'], 'write')
Ejemplo n.º 3
0
 def test_render_node(self):
     node = ProjectFactory()
     res = _render_node(node)
     assert_equal(res['title'], node.title)
     assert_equal(res['id'], node._primary_key)
     assert_equal(res['url'], node.url)
     assert_equal(res['api_url'], node.api_url)
     assert_equal(res['primary'], node.primary)
     assert_equal(res['date_modified'], framework_utils.iso8601format(node.date_modified))
     assert_equal(res['category'], 'project')
Ejemplo n.º 4
0
 def test_render_node(self):
     node = ProjectFactory()
     res = _render_node(node)
     assert_equal(res['title'], node.title)
     assert_equal(res['id'], node._primary_key)
     assert_equal(res['url'], node.url)
     assert_equal(res['api_url'], node.api_url)
     assert_equal(res['primary'], node.primary)
     assert_equal(res['date_modified'], framework_utils.iso8601format(node.date_modified))
     assert_equal(res['category'], 'project')
Ejemplo n.º 5
0
 def test_render_node(self):
     node = ProjectFactory()
     res = _render_node(node)
     assert_equal(res["title"], node.title)
     assert_equal(res["id"], node._primary_key)
     assert_equal(res["url"], node.url)
     assert_equal(res["api_url"], node.api_url)
     assert_equal(res["primary"], node.primary)
     assert_equal(res["date_modified"], framework_utils.iso8601format(node.date_modified))
     assert_equal(res["category"], "project")