<commit_before>#!/usr/bin/perl
use Test::More tests => 6;

use strict;
use warnings;
use Carp;

use CXGN::VHost::Test;
use CXGN::Phenome::GenericGenePage;
use CXGN::DB::Connection;

$SIG{__DIE__} = \&Carp::confess;

my $dbh = CXGN::DB::Connection->new({ dbargs => {AutoCommit => 1} });

my $ggp = CXGN::Phenome::GenericGenePage
    ->new( -id => 428,
	   -dbh => $dbh,
	 );

test_xml( $ggp->render_xml );

# now test it on the site
my $url = '/phenome/generic_gene_page.pl';
my $result = get( "$url?locus_id=428" );
test_xml( $result );

sub test_xml {
    my $x = shift;
    like( $x, qr/dwarf/, 'result looks OK');
    like( $x, qr/<gene/, 'result looks OK');
    like( $x, qr/<data_provider>/, 'result looks OK');
}
<commit_msg>Get rid of CXGN::VHost::Test in a test<commit_after>#!/usr/bin/perl
use Test::More tests => 6;

use strict;
use warnings;
use Carp;
use lib 't/lib';
use SGN::Test::WWW::Mechanize;
use CXGN::Phenome::GenericGenePage;
use CXGN::DB::Connection;

$SIG{__DIE__} = \&Carp::confess;

my $dbh = CXGN::DB::Connection->new({ dbargs => {AutoCommit => 1} });
my $mech = SGN::Test::WWW::Mechanize->new;

my $ggp = CXGN::Phenome::GenericGenePage
    ->new( -id => 428,
	   -dbh => $dbh,
	 );

test_xml( $ggp->render_xml );

# now test it on the site
my $url = '/phenome/generic_gene_page.pl';
$mech->get( "$url?locus_id=428" );
test_xml( $mech->content );

sub test_xml {
    my ($content) = @_;
    like( $content, qr/dwarf/, 'result looks OK');
    like( $content, qr/<gene/, 'result looks OK');
    like( $content, qr/<data_provider>/, 'result looks OK');
}

{'fraction_non_alphanumeric': 0.20215462610899873, 'fraction_numerical': 0.010139416983523447, 'mean_word_length': 4.228476821192053, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2336682', 'n_tokens_mistral': 682, 'n_tokens_neox': 639, 'n_words': 155}