You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: test_delivery.rb
    path of file: ./repos/mailanes/test
    
    the code of the file until where you have to start completion: # frozen_string_literal: tru
    
  def test_creates_delivery
    owner = random_owner
    list = Lists.new(owner: owner, pgsql: t_pgsql).add
    recipient = list.recipients.add('test@mailanes.com')
    lane = Lanes.new(owner: owner, pgsql: t_pgsql).add
    campaign = Campaigns.new(owner: owner, pgsql: t_pgsql).add(list, lane)
    letter = lane.letters.add
    deliveries = Deliveries.new(pgsql: t_pgsql)
    delivery = deliveries.add(campaign, letter, recipient)
    assert(delivery.opened.empty?)
    delivery.just_opened
    assert(!delivery.opened.empty?)
    delivery.unsubscribe
  end