'Test for backwards-compatibility with an essex/folsom bug.
Non-indexed attributes were returned in an \'extra\' attribute, instead
of on the entity itself; for consistency and backwards compatibility,
those attributes should be included twice.
This behavior is specific to the SQL driver.'

def test_update_user_returns_extra(self):

    arbitrary_key = uuid.uuid4().hex
    arbitrary_value = uuid.uuid4().hex
    user = unit.new_user_ref(domain_id=CONF.identity.default_domain_id)
    user[arbitrary_key] = arbitrary_value
    del user['id']
    ref = self.identity_api.create_user(user)
    self.assertEqual(arbitrary_value, ref[arbitrary_key])
    self.assertIsNone(ref.get('password'))
    self.assertIsNone(ref.get('extra'))
    user['name'] = uuid.uuid4().hex
    user['password'] = uuid.uuid4().hex
    ref = self.identity_api.update_user(ref['id'], user)
    self.assertIsNone(ref.get('password'))
    self.assertIsNone(ref['extra'].get('password'))
    self.assertEqual(arbitrary_value, ref[arbitrary_key])
    self.assertEqual(arbitrary_value, ref['extra'][arbitrary_key])
