From 0c0ada2386efd99a895214b406a9db645fa7d036 Mon Sep 17 00:00:00 2001 From: Rene Krenn Date: Thu, 28 Jan 2016 12:42:19 +0100 Subject: [PATCH] MT#17607 tests: use default billing profile for providers by default +set RATEOMAT_SPLIT_PEAK_PARTS = 1 for rateomat-split-cdr.t Change-Id: I6252d71cf437ab95e5bed9e82919456087881628 --- rate-o-mat.pl | 2 +- t/Utils/Api.pm | 14 ++++++++------ t/rateomat-split-cdr.t | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/rate-o-mat.pl b/rate-o-mat.pl index 85fdd50..c570828 100755 --- a/rate-o-mat.pl +++ b/rate-o-mat.pl @@ -713,7 +713,7 @@ sub add_interval { } elsif($unit eq "hour") { $to_time = mktime($from_second,$from_minute,$from_hour + $count,$from_day,$from_month,$from_year); } elsif($unit eq "day") { - $to_time = mktime($from_second,$from_minute,$from_hour,$from_day + $count,$from_month,$from_year); + $to_time = mktime($from_second,$from_minute,$from_hour,$from_day + $count,$from_month,$from_year); } elsif($unit eq "week") { $to_time = mktime($from_second,$from_minute,$from_hour,$from_day + 7*$count,$from_month,$from_year); } elsif($unit eq "month") { diff --git a/t/Utils/Api.pm b/t/Utils/Api.pm index 90e148b..3fcaa13 100644 --- a/t/Utils/Api.pm +++ b/t/Utils/Api.pm @@ -692,15 +692,17 @@ sub setup_provider { ); $provider->{profile} = $profile_fee->{profile}; $provider->{provider_fee} = $profile_fee; + $provider->{contract} = update_item($provider->{contract}, + billing_profile_id => $provider->{profile}->{id}, + ); } else { ok(!$split_peak_parts,'provider rate required for split cdrs'); - $provider->{profile} = create_billing_profile( - reseller_id => $provider->{reseller}->{id}, - ); + #use default billing profile id, which already comes with fees. + #$provider->{profile} = create_billing_profile( + # reseller_id => $provider->{reseller}->{id}, + #); } - $provider->{contract} = update_item($provider->{contract}, - billing_profile_id => $provider->{profile}->{id}, - ); + $provider->{domain} = create_domain( reseller_id => $provider->{reseller}->{id}, domain => $domain_name.'.', diff --git a/t/rateomat-split-cdr.t b/t/rateomat-split-cdr.t index 7c34780..30b5a06 100644 --- a/t/rateomat-split-cdr.t +++ b/t/rateomat-split-cdr.t @@ -5,7 +5,7 @@ use Utils::Api qw(); use Utils::Rateomat qw(); use Test::More; -#THIS TEST CASE REQUIRES RATEOMAT_SPLIT_PEAK_PARTS=1 ! +$ENV{RATEOMAT_SPLIT_PEAK_PARTS} = 1; #use Text::Table; #use Text::Wrap;