'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, size=19)
    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)
    res = self.get_api_response_ext(http.OK, url='/images?sort_key=created_at&sort_dir=asc')
    self.assertEqualImages(res, (UUID2, UUID4, UUID3))
