Enforce anchor tenant domain create period

This verifies anchor tenant creates by registrars are for exactly 2 years, to simplify billing down the line (anchor tenants get 2 years of free domain creates).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193931858
This commit is contained in:
larryruili 2018-04-23 09:01:25 -07:00 committed by jianglai
parent 139c8e190d
commit f56355c9e8
4 changed files with 59 additions and 0 deletions

View file

@ -65,6 +65,7 @@ import google.registry.flows.EppException.UnimplementedExtensionException;
import google.registry.flows.EppRequestSource;
import google.registry.flows.ExtensionManager.UndeclaredServiceExtensionException;
import google.registry.flows.ResourceFlowTestCase;
import google.registry.flows.domain.DomainCreateFlow.AnchorTenantCreatePeriodException;
import google.registry.flows.domain.DomainCreateFlow.DomainHasOpenApplicationsException;
import google.registry.flows.domain.DomainCreateFlow.MustHaveSignedMarksInCurrentPhaseException;
import google.registry.flows.domain.DomainCreateFlow.NoGeneralRegistrationsInCurrentPhaseException;
@ -1059,6 +1060,14 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testFailure_anchorTenantViaAuthCode_notTwoYearPeriod() throws Exception {
setEppInput("domain_create_anchor_authcode_invalid_years.xml");
persistContactsAndHosts();
EppException thrown = assertThrows(AnchorTenantCreatePeriodException.class, this::runFlow);
assertAboutEppExceptions().that(thrown).marshalsToXml();
}
@Test
public void testSuccess_anchorTenantViaAuthCode_matchingLrpToken() throws Exception {
// This is definitely a corner case, as (without superuser) anchor tenants may only register