Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #595 from uktrade/GBAU-906-removing-transition-form
Browse files Browse the repository at this point in the history
Removed EU transtion option from contact form
  • Loading branch information
webbyfox committed Jan 20, 2021
2 parents 1ae8cea + b35f750 commit 086cb94
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 238 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Implemented enhancements

- GBAU - 906 Removed EU transition option from contact form

### Bugs fixed


Expand Down
6 changes: 0 additions & 6 deletions conf/tests/test_url_redirects.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,6 @@ def test_privacy_international_redirect(path, client):
'/transition/',
'/international/content/invest/how-to-setup-in-the-uk/transition-period/'
),
(
'/eu-exit-news/contact/', reverse('brexit-contact-form')
),
(
'/eu-exit-news/contact/success/', reverse('brexit-contact-form-success')
),
(
'/redarrows/',
'https://www.events.great.gov.uk/red-arrows-north-america-tour/'
Expand Down
16 changes: 0 additions & 16 deletions conf/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import casestudy.views
import contact.views
import core.views
import euexit.views
import finance.views
import marketaccess.views
import community.views
Expand Down Expand Up @@ -224,20 +223,6 @@
]


euexit_urls = [
url(
r'^transition-period/contact/$',
euexit.views.DomesticContactFormView.as_view(),
name='brexit-contact-form'
),
url(
r'^transition-period/contact/success/$',
euexit.views.DomesticContactSuccessView.as_view(),
name='brexit-contact-form-success'
),
]


article_urls = [
url(
r"^tagged/(?P<slug>[\w-]+)/$",
Expand Down Expand Up @@ -627,7 +612,6 @@


urlpatterns += legacy_urls
urlpatterns += euexit_urls
urlpatterns += redirects
urlpatterns += article_urls
urlpatterns += contact_urls
Expand Down
18 changes: 0 additions & 18 deletions contact/forms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from datetime import datetime
import re

from captcha.fields import ReCaptchaField
Expand All @@ -10,9 +9,7 @@

from django.conf import settings
from django.forms import Textarea, TextInput, TypedChoiceField, ValidationError
from django.utils import timezone
from django.utils.html import mark_safe
from django.utils.functional import LazyObject

from core.forms import ConsentFieldMixin, TERMS_LABEL
from core.validators import is_valid_postcode
Expand All @@ -24,19 +21,6 @@
PHONE_NUMBER_REGEX = re.compile(r'^(\+\d{1,3}[- ]?)?\d{8,16}$')


class LazyEUExitLabel(LazyObject):
POST_BREXIT = 'The transition period (now that the UK has left the EU)'
PRE_BREXIT = 'The UK leaving the EU and transition period'

@property
def _wrapped(self):
if timezone.now() > timezone.make_aware(datetime(2020, 1, 31, 23)):
return self.POST_BREXIT
return self.PRE_BREXIT


EU_EXIT_LABEL = LazyEUExitLabel()

LIMITED = 'LIMITED'

COMPANY_TYPE_CHOICES = (
Expand Down Expand Up @@ -97,7 +81,6 @@ class DomesticRoutingForm(forms.Form):
'great.gov.uk account and services support'
),
(constants.FINANCE, 'UK Export Finance (UKEF)'),
(constants.EUEXIT, EU_EXIT_LABEL),
(constants.EVENTS, 'Events'),
(constants.DSO, 'Defence and Security Organisation (DSO)'),
(constants.OTHER, 'Other'),
Expand Down Expand Up @@ -186,7 +169,6 @@ def international_choices():
(constants.CAPITAL_INVEST, 'Capital investment in the UK'),
(constants.EXPORTING_TO_UK, 'Exporting to the UK'),
(constants.BUYING, 'Find a UK business partner'),
(constants.EUEXIT, EU_EXIT_LABEL),
(constants.OTHER, 'Other'),
)

Expand Down
13 changes: 0 additions & 13 deletions contact/tests/test_forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from directory_api_client.exporting import url_lookup_by_postcode
from freezegun import freeze_time
import pytest
import requests
import requests_mock
Expand Down Expand Up @@ -42,7 +41,6 @@ def test_domestic_form_routing():
constants.TRADE_OFFICE,
constants.EXPORT_ADVICE,
constants.FINANCE,
constants.EUEXIT,
constants.EVENTS,
constants.DSO,
constants.OTHER,
Expand Down Expand Up @@ -296,17 +294,6 @@ def test_routing_forms_feature_flag_for_int_routing_form(value_one, value_two, f
assert any(value == constants.EXPORTING_TO_UK for value, label in choices) is value_two


@pytest.mark.parametrize('current_date,expected', (
['2020-01-30 22:59:00', forms.LazyEUExitLabel.PRE_BREXIT],
['2020-01-31 23:00:00', forms.LazyEUExitLabel.PRE_BREXIT],
['2020-02-01 23:00:01', forms.LazyEUExitLabel.POST_BREXIT],
))
def test_routing_forms_euexit(current_date, expected):
with freeze_time(current_date):
assert forms.DomesticRoutingForm().fields['choice'].choices[4][1] == expected
assert forms.InternationalRoutingForm().fields['choice'].choices[4][1] == expected


def test_marketing_form_validations(valid_request_export_support_form_data):
form = forms.ExportSupportForm(data=valid_request_export_support_form_data)
assert form.is_valid()
Expand Down
5 changes: 0 additions & 5 deletions contact/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ def domestic_form_data(captcha_stub):
kwargs={'step': 'contact'},
)
),
(
constants.DOMESTIC,
constants.EUEXIT,
reverse('brexit-contact-form'),
),
(
constants.DOMESTIC,
constants.EVENTS,
Expand Down
180 changes: 0 additions & 180 deletions euexit/tests/test_views.py

This file was deleted.

0 comments on commit 086cb94

Please sign in to comment.