

def test_bulk_creates_children_logged_in_owner(self):
    res = self.app.post_json_api(self.url, {
        'data': [self.child, self.child_two],
    }, auth=self.user.auth, bulk=True)
    assert_equal(res.status_code, 201)
    assert_equal(res.json['data'][0]['attributes']['title'], self.child['attributes']['title'])
    assert_equal(res.json['data'][0]['attributes']['description'], self.child['attributes']['description'])
    assert_equal(res.json['data'][0]['attributes']['category'], self.child['attributes']['category'])
    assert_equal(res.json['data'][1]['attributes']['title'], self.child_two['attributes']['title'])
    assert_equal(res.json['data'][1]['attributes']['description'], self.child_two['attributes']['description'])
    assert_equal(res.json['data'][1]['attributes']['category'], self.child_two['attributes']['category'])
    self.project.reload()
    assert_equal(res.json['data'][0]['id'], self.project.nodes[0]._id)
    assert_equal(res.json['data'][1]['id'], self.project.nodes[1]._id)
    assert_equal(self.project.nodes[0].logs[0].action, NodeLog.PROJECT_CREATED)
    assert_equal(self.project.nodes[1].logs[0].action, NodeLog.PROJECT_CREATED)

dataset/ETHPy150Open CenterForOpenScience/osf.io/api_tests/nodes/views/test_node_children_list.py TestNodeChildrenBulkCreate.test_bulk_creates_children_logged_in_owner/original