def test_admin_delete_contact(database, mock_message): User.create_admin(2, 2, database) character_hash = User.create_user(4, 4, "Test user", database) character_hash_2 = User.create_user(3, 3, "Test user 2", database) client = BankingClientFactory(database).create_client(mock_message) client.admin_add_contact( f"/admin_add_contact {character_hash} {character_hash_2} somebody") assert client.admin_delete_contact( f"/admin_delete_contact {character_hash} {character_hash_2}" ) == ADDRESS_RECORD_DELETION_MESSAGE
def test_admin_add_contact(database, mock_message): User.create_admin(2, 2, database) character_hash = User.create_user(4, 4, "Test user", database) character_hash_2 = User.create_user(3, 3, "Test user 2", database) client = BankingClientFactory(database).create_client(mock_message) with pytest.raises(AddressRecordError): client.admin_add_contact( f"/admin_add_contact {character_hash} {character_hash} SELF") assert client.admin_add_contact( f"/admin_add_contact {character_hash} {character_hash_2} somebody" ) == ADDRESS_RECORD_ADDED with pytest.raises(AddressRecordError): client.admin_add_contact( f"/admin_add_contact {character_hash} {character_hash_2} somebody")
def test_admin_inspect_contact_list(database, mock_message): User.create_admin(2, 2, database) character_hash = User.create_user(4, 4, "Test user", database) character_hash_2 = User.create_user(3, 3, "Test user 2", database) client = BankingClientFactory(database).create_client(mock_message) assert client.admin_inspect_contact_list( f"/admin_inspect_contact_list {character_hash}") == NO_ADDRESS_RECORDS assert client.admin_inspect_contact_list( f"/admin_inspect_contact_list {character_hash_2}" ) == NO_ADDRESS_RECORDS client.admin_add_contact( f"/admin_add_contact {character_hash} {character_hash_2} somebody") assert client.admin_inspect_contact_list( f"/admin_inspect_contact_list {character_hash}") != NO_ADDRESS_RECORDS assert client.admin_inspect_contact_list( f"/admin_inspect_contact_list {character_hash_2}" ) == NO_ADDRESS_RECORDS