Bug 24606: (QA follow-up) Fix Template.t

The test cases here still assumed UTF-8 enocding in the middle
of the process. Can be much simpler.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Marcel de Rooy 2022-11-22 15:49:02 +00:00 committed by Tomas Cohen Arazi
parent 5e51279ce9
commit 7c7db3eb6b
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -50,18 +50,8 @@ subtest 'Serializing and deserializing contents' => sub {
} }
)->store(); )->store();
my $encoded_data; is( $template->contents, JSON->new->encode($data), 'Contents serialized correctly' );
foreach my $key ( keys %{$data} ) { is_deeply( $template->decoded_contents, $data, 'Contents deserialized correctly' );
$encoded_data->{$key} = Encode::encode('UTF-8', $data->{$key});
}
is( $template->contents, JSON->new->utf8->encode($data), 'Contents serialized correctly' );
is_deeply(
$template->decoded_contents,
$encoded_data,
'Contents deserialized and UTF-8 encoded correctly'
);
$schema->storage->txn_rollback; $schema->storage->txn_rollback;
}; };