

def test_creates_child_incorrect_type(self):
    child = {
        'data': {
            'type': 'Wrong type.',
            'attributes': {
                'title': 'child',
                'description': 'this is a child project',
                'category': 'project',
            },
        },
    }
    res = self.app.post_json_api(self.url, child, auth=self.user.auth, expect_errors=True)
    assert_equal(res.status_code, 409)
    assert_equal(res.json['errors'][0]['detail'], 'Resource identifier does not match server endpoint.')

dataset/ETHPy150Open CenterForOpenScience/osf.io/api_tests/nodes/views/test_node_children_list.py TestNodeChildCreate.test_creates_child_incorrect_type/original