'Tests that the /images registry API returns list of
public images sorted by created_at in ascending order.'

def test_get_index_sort_created_at_asc(self):

    now = timeutils.utcnow()
    time1 = (now + datetime.timedelta(seconds=5))
    time2 = now
    UUID3 = _gen_uuid()
    extra_fixture = self.get_fixture(id=UUID3, created_at=time1)
    db_api.image_create(self.context, extra_fixture)
    UUID4 = _gen_uuid()
    extra_fixture = self.get_fixture(id=UUID4, created_at=time2)
    db_api.image_create(self.context, extra_fixture)
    images = self.client.get_images(sort_key='created_at', sort_dir='asc')
    self.assertEqualImages(images, (UUID2, UUID4, UUID3), unjsonify=False)
