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: package_group_role_relationship_test.rb
    path of file: ./repos/open-build-service/src/api/test/unit
    
    the code of the file until where you have to start completion: require_relative '../test_helper'

class PackageGroupRoleRelationshipTest < ActiveSupport::TestCase
  def test_validation
    # empty == invalid
    pgr = Relationship.new
    assert_equal true, pgr.invalid?
    assert_equal false, pgr.save
    # only role
    pgr.role = Role.find_by_title('maintainer')
    assert_equal tr
    
  def test_validation
    # empty == invalid
    pgr = Relationship.new
    assert_equal true, pgr.invalid?
    assert_equal false, pgr.save
    # only role
    pgr.role = Role.find_by_title('maintainer')
    assert_equal true, pgr.invalid?
    assert_equal false, pgr.save
    pgr.package = Package.find_by_name('kdelibs')
    assert_equal true, pgr.invalid?
    assert_equal false, pgr.save
    # bad group
    pgr.group = Group.find_by_title('reviewer')
    assert_equal true, pgr.invalid?
    assert_equal false, pgr.save
    # now good?
    pgr.group = Group.find_by_title('test_group')
    assert_equal true, pgr.invalid?
    pgr.group = Group.find_by_title('test_group_b')
    assert_equal false, pgr.invalid?
    assert_equal true, pgr.save

    pgr = pgr.dup
    # not another time
    assert_equal false, pgr.valid?
  end