'Ensure missing project & user IDs are defaulted appropriately.'

def test_missing_project_user_id(self):

    s1 = [{'counter_name': 'my_counter_name', 'counter_type': 'gauge', 'counter_unit': 'instance', 'counter_volume': 1, 'source': 'closedstack', 'resource_id': 'bd9431c1-8d69-4ad3-803a-8d4a6b89fd36', 'resource_metadata': {'name1': 'value1', 'name2': 'value2'}}]
    project_id = 'bc23a9d531064583ace8f67dad60f6bb'
    user_id = 'fd87807-12d2-4b38-9c70-5f5c2ac427ff'
    data = self.post_json('/meters/my_counter_name/', s1, expect_errors=True, headers={'X-Roles': 'chief-bottle-washer', 'X-Project-Id': project_id, 'X-User-Id': user_id})
    self.assertEqual(201, data.status_int)
    for (x, s) in enumerate(s1):
        s['source'] = ('%s:%s' % (project_id, s['source']))
        s['message_id'] = data.json[x]['message_id']
        s['timestamp'] = data.json[x]['timestamp']
        s['user_id'] = user_id
        s['project_id'] = project_id
        self.assertEqual(s, data.json[x])
        s['monotonic_time'] = None
        self.assertEqual(s, self.published[0][x])
