Skip to content

Commit

Permalink
Tp2000 1186 ref doc data model (#1164)
Browse files Browse the repository at this point in the history
* TP2000-1168 Add sub-quota, blocking period & suspension period nested review tabs (#1133)

* Add sub-quotas nested review tab

* Add quota blocking periods nested review tab

* Add quota suspension periods nested review tab

* Use tab title instead of model verbose name

* Add blocking period and suspension period SID to table

* Feat: expand expiring quotas report to include tabs (#1131)

* feat: invoke UI changes to reports and create new URL path to handle reports with multiple tabs (#1134)

* feat: Add both CSV and excel types for charts exporting (#1136)

* TP2000-1185  Add maintenance mode (#1137)

* Add MAINTENANCE_MODE setting and middleware

* Fix middleware removal and recursive redirect

* Add template view and url

* Add tests

* Update contact us form link for other pages

* Update text wording

* Remove database route during maintenance

* Update maintenance page template/url name

---------

Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>

* Increment message id & record sequence number correctly (#1083)

* record seq number & message id fix

* fix taricXMLRenderer, pass in value of counter

* feat: implement URLs for quota reports to ease navigation (#1135)

* Update readme with maintenance mode instructions. (#1140)

* TP2000-1130 Move current workbasket from Session to custom User model (#1123)

* Update User model references

* Use custom User model

* TP2000-1152-handling-invalid-workbaskets (#1113)

* Update middleware to check for workbasket changing state

* Update to use decorator rather than middleware, add pytest fixtures

* Update tests that require a session workbasket to run

* Move views and urls to workbasket app and update template

* Add tests for when workbasket status changes

* Tidy up following Pauls comments

* Update models and templates to find workbasket in user model

* Update test fixtures for workbasket being in user model

* Tidy up and test updates

* Update referencing to User model

* Updating bdd tests for new user model

* Add and update view and model unit tests

* Update require_current_workbasket decorator docstring

* Add docstring, move template for NoActiveWorkBasket view

* Amend current workbasket id retrieval in template

* Amend custom User model migration

* Remake migration adding current_workbasket field to User model

* Remove unused ValidateSessionWorkBasketMiddleware

* Make current_workbasket optional

* Add User model to admin

* Use historical models to fix migration tests

* Move ContentType data migration so it may be applied

* Rename function to remove a users current workbasket

* Amend docstrings

* Remove reference to session middleware that is no longer used

* Update workbaskets models following Pauls review

* Bring back user workbasket middleware as extra security

* Move User model from workbaskets app to common app

* Add forgotten content type data migration

* Remove setup_content_type fixture following patch to migrator fixture

* Amend middleware util method name

* Remove uneeded DoesNotExist try except block

---------

Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>

* Bump aiohttp from 3.9.1 to 3.9.2 (#1142)

Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.1 to 3.9.2.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](aio-libs/aiohttp@v3.9.1...v3.9.2)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* initial commit - ref doc data model

* update importer model matching to account for end dated objects. (#1146)

* update importer model matching to account for end dated objects.

* update importer model matching to account for end dated objects.

* Tp2000 1211 (#1148)

* update govuk dependency since its been deleted at source

* update govuk dependency since its been deleted at source

* initial commit - ref doc data model

* wip commit

* Bump django from 3.2.23 to 3.2.24 (#1150)

Bumps [django](https://github.com/django/django) from 3.2.23 to 3.2.24.
- [Commits](django/django@3.2.23...3.2.24)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Tp2000 652  force rule check after real edit (#1130)

* added a check that if tracked models have been updated since the last checks business rules need run again
* data migration to add timestamps to tracked models and transaction checks
* tests for real edits
* tests for data migrations

* TP2000-1219  Prevent maintenance mode errors (#1152)

* Remove authbroker middleware when in maintenance mode

* Skip applying migrations in init script

* Prevent maintenance mode template attempts to access user attribute on request object

* Update privacy policy link

* initial commit - ref doc data model

* wip commit

* initial commit - ref doc data model

* wip commit

* wip commit

* wip commit

* added alignment report, reference document and reference document version views, refactored the checks and ran the checks several times against reference document versions.

* TP2000-1168 Add sub-quota, blocking period & suspension period nested review tabs (#1133)

* Add sub-quotas nested review tab

* Add quota blocking periods nested review tab

* Add quota suspension periods nested review tab

* Use tab title instead of model verbose name

* Add blocking period and suspension period SID to table

* Feat: expand expiring quotas report to include tabs (#1131)

* feat: invoke UI changes to reports and create new URL path to handle reports with multiple tabs (#1134)

* feat: Add both CSV and excel types for charts exporting (#1136)

* TP2000-1185  Add maintenance mode (#1137)

* Add MAINTENANCE_MODE setting and middleware

* Fix middleware removal and recursive redirect

* Add template view and url

* Add tests

* Update contact us form link for other pages

* Update text wording

* Remove database route during maintenance

* Update maintenance page template/url name

---------

Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>

* Increment message id & record sequence number correctly (#1083)

* record seq number & message id fix

* fix taricXMLRenderer, pass in value of counter

* feat: implement URLs for quota reports to ease navigation (#1135)

* Update readme with maintenance mode instructions. (#1140)

* TP2000-1130 Move current workbasket from Session to custom User model (#1123)

* Update User model references

* Use custom User model

* TP2000-1152-handling-invalid-workbaskets (#1113)

* Update middleware to check for workbasket changing state

* Update to use decorator rather than middleware, add pytest fixtures

* Update tests that require a session workbasket to run

* Move views and urls to workbasket app and update template

* Add tests for when workbasket status changes

* Tidy up following Pauls comments

* Update models and templates to find workbasket in user model

* Update test fixtures for workbasket being in user model

* Tidy up and test updates

* Update referencing to User model

* Updating bdd tests for new user model

* Add and update view and model unit tests

* Update require_current_workbasket decorator docstring

* Add docstring, move template for NoActiveWorkBasket view

* Amend current workbasket id retrieval in template

* Amend custom User model migration

* Remake migration adding current_workbasket field to User model

* Remove unused ValidateSessionWorkBasketMiddleware

* Make current_workbasket optional

* Add User model to admin

* Use historical models to fix migration tests

* Move ContentType data migration so it may be applied

* Rename function to remove a users current workbasket

* Amend docstrings

* Remove reference to session middleware that is no longer used

* Update workbaskets models following Pauls review

* Bring back user workbasket middleware as extra security

* Move User model from workbaskets app to common app

* Add forgotten content type data migration

* Remove setup_content_type fixture following patch to migrator fixture

* Amend middleware util method name

* Remove uneeded DoesNotExist try except block

---------

Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>

* Bump aiohttp from 3.9.1 to 3.9.2 (#1142)

Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.1 to 3.9.2.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](aio-libs/aiohttp@v3.9.1...v3.9.2)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* update importer model matching to account for end dated objects. (#1146)

* update importer model matching to account for end dated objects.

* update importer model matching to account for end dated objects.

* Tp2000 1211 (#1148)

* update govuk dependency since its been deleted at source

* update govuk dependency since its been deleted at source

* Bump django from 3.2.23 to 3.2.24 (#1150)

Bumps [django](https://github.com/django/django) from 3.2.23 to 3.2.24.
- [Commits](django/django@3.2.23...3.2.24)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Tp2000 652  force rule check after real edit (#1130)

* added a check that if tracked models have been updated since the last checks business rules need run again
* data migration to add timestamps to tracked models and transaction checks
* tests for real edits
* tests for data migrations

* TP2000-1219  Prevent maintenance mode errors (#1152)

* Remove authbroker middleware when in maintenance mode

* Skip applying migrations in init script

* Prevent maintenance mode template attempts to access user attribute on request object

* Update privacy policy link

* Formatting updates and adding end date field to footnote create (#1154)

* TP2000-1114: React enhanced forms proof of concept (#1091)

* Add react

* Start to build origins form in react

* Build quota origin form with initial data

* Enable adding/removing of origins

* Repopulate form initial in case of error on submit

* Pass errors from django to react

* Create origins

* Add aria attribute

* Reinstate geo area descriptions in form

* Organise JS, code comments

* Add key for react list

* Simplify if statement

* Add exclusions formset

* Add jest for react testing

* Amend gitignore

* Fix error re-rendering component after submit fail

* Move state management into top level component

* Pass origin index to exclusions formset

* Submit origin pk

* Update constants.py

* Test form cleaned_data

* Update quota origins to use with_latest_description

* Use description from annotated query

* Update origins and add test

* Update origin exclusions

* Don't remove empty data

* Fix exclusions not pre-populating

* Add jest snapshot tests

* Add react tests

* Add jest tests to github actions

* Fix query not returning origin exclusions

* Fix disabled widget error

* Fix origins no longer being linked to quota when order number updated

* Update tests for workbasket change

* Add tests for add_extra_error form method

* Fix incorrect exclusion being removed

* Clean up babel config

* Remove unused field

* Create exclusions for updated and new origins

* Make sure exclusions are updated/deleted

* Move current() queryset into init

* Fix geographical area invalid choice error in test

* Move babel packages out of dev deps (#1155)

* initial commit - ref doc data model

* wip commit

* initial commit - ref doc data model

* wip commit

* wip commit

* initial commit - ref doc data model

* wip commit

* initial commit - ref doc data model

* wip commit

* added alignment report, reference document and reference document version views, refactored the checks and ran the checks several times against reference document versions.

* added alignment report, reference document and reference document version views, refactored the checks and ran the checks several times against reference document versions.

* prep for merge to mega branch

* prep for merge to mega branch

* prep for merge to mega branch

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Dale Cannon <118175145+dalecannon@users.noreply.github.com>
Co-authored-by: Tash Boyse <57753415+nboyse@users.noreply.github.com>
Co-authored-by: Matthew McKenzie <97194636+mattjamc@users.noreply.github.com>
Co-authored-by: Dale Cannon <dale.cannon@digital.trade.gov.uk>
Co-authored-by: A Gleeson <anthoni.gleeson@digital.trade.gov.uk>
Co-authored-by: Paul Pepper <85895113+paulpepper-trade@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Edie Pearce <edie.pearce@digital.trade.gov.uk>
  • Loading branch information
9 people committed Feb 23, 2024
1 parent aa67405 commit e10118a
Show file tree
Hide file tree
Showing 178 changed files with 17,892 additions and 3,355 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/jest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI/CD

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
test:
name: "Run jest tests"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Node
uses: ./.github/actions/setup-node

- name: Run tests
run: npm run test
9 changes: 7 additions & 2 deletions .profile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
# ref - https://docs.cloudfoundry.org/devguide/deploy-apps/deploy-app.html

echo "---- RUNNING release tasks (.profile) ------"
echo "---- Apply Migrations ------"
python manage.py migrate

if [[ "$MAINTENANCE_MODE" != "True" && "$MAINTENANCE_MODE" != "true" ]] ; then
echo "---- Apply Migrations ------"
python manage.py migrate
else
echo "---- Skip Applying Migrations (Maintenance Mode) ------"
fi

echo "---- Collect Static Files ------"
OUTPUT=$(python manage.py collectstatic --noinput --clear)
Expand Down
26 changes: 26 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,32 @@ We use a shared service accross the department for virus scanning to run locally
3. add CLAM_AV_DOMAIN without http(s)://
4. set CLAM_AV_USERNAME,CLAM_AV_PASSWORD as the username and password found in the config.py in the dit-clamav-rest project


Application maintenance mode
----------------------------

The application can be put into a "maintenance mode" type of operation. By doing
so, all user web access is routed to a maintenance view and the default database
route removes the application's access to the database. This prevents
inadvertent changes by users, via the application UI, to application data while
in maintenance mode. Note, however, that this would not restrict other forms of
data update, such as active Celery tasks - Celery and other similar processes
need to be scaled down separately.

The process for transitioning the application into and back out of maintenance
mode is as follows:

1. Set the application’s `MAINTENANCE_MODE` environment variable to `True`.

2. Restart the application so that it picks up the new value of `MAINTENANCE_MODE`.

3. Complete maintenance activities.

4. Set the value of the `MAINTENANCE_MODE` environment variable to `False`.

5. Restart the application.


How to contribute
-----------------

Expand Down
36 changes: 28 additions & 8 deletions additional_codes/tests/bdd/test_edit_additional_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,24 @@

@pytest.fixture
@when("I edit additional code X000")
def model_edit_page(client, additional_code_X000):
return client.get(additional_code_X000.get_url("edit"))
def model_edit_page(client_with_current_workbasket, additional_code_X000):
return client_with_current_workbasket.get(additional_code_X000.get_url("edit"))


@pytest.fixture
@when("I edit additional code X000")
def model_edit_page_invalid_user(
client_with_current_workbasket_no_permissions,
additional_code_X000,
):
return client_with_current_workbasket_no_permissions.get(
additional_code_X000.get_url("edit"),
)


@then("I am not permitted to edit")
def edit_permission_denied(model_edit_page):
assert model_edit_page.status_code == 403
def edit_permission_denied(model_edit_page_invalid_user):
assert model_edit_page_invalid_user.status_code == 403


@then("I see an edit form")
Expand All @@ -31,8 +42,12 @@ def edit_permission_granted(model_edit_page):

@pytest.fixture
@when("I set the end date before the start date on additional code X000")
def end_date_before_start(client, response, additional_code_X000):
response["response"] = client.post(
def end_date_before_start(
client_with_current_workbasket,
response,
additional_code_X000,
):
response["response"] = client_with_current_workbasket.post(
additional_code_X000.get_url("edit"),
validity_period_post_data(
start=date(2021, 1, 1),
Expand All @@ -44,8 +59,13 @@ def end_date_before_start(client, response, additional_code_X000):
@when(
"I set the start date of additional code X000 to overlap the previous additional code",
)
def submit_overlapping(client, response, additional_code_X000, old_additional_code):
response["response"] = client.post(
def submit_overlapping(
client_with_current_workbasket,
response,
additional_code_X000,
old_additional_code,
):
response["response"] = client_with_current_workbasket.post(
additional_code_X000.get_url("edit"),
validity_period_post_data(
start=old_additional_code.valid_between.lower,
Expand Down
17 changes: 13 additions & 4 deletions additional_codes/tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


# https://uktrade.atlassian.net/browse/TP2000-296
def test_additional_code_create_sid(session_with_workbasket, date_ranges):
def test_additional_code_create_sid(session_request_with_workbasket, date_ranges):
"""Tests that additional code type is NOT considered when generating a new
sid."""
type_1 = factories.AdditionalCodeTypeFactory.create()
Expand All @@ -21,7 +21,10 @@ def test_additional_code_create_sid(session_with_workbasket, date_ranges):
"start_date_1": date_ranges.normal.lower.month,
"start_date_2": date_ranges.normal.lower.year,
}
form = forms.AdditionalCodeCreateForm(data=data, request=session_with_workbasket)
form = forms.AdditionalCodeCreateForm(
data=data,
request=session_request_with_workbasket,
)

assert form.is_valid()

Expand All @@ -30,7 +33,10 @@ def test_additional_code_create_sid(session_with_workbasket, date_ranges):
assert new_additional_code.sid != additional_code.sid


def test_additional_code_create_valid_data(session_with_workbasket, date_ranges):
def test_additional_code_create_valid_data(
session_request_with_workbasket,
date_ranges,
):
"""Tests that AdditionalCodeCreateForm.is_valid() returns True when passed
required fields and additional_code_description values in cleaned data."""
code_type = factories.AdditionalCodeTypeFactory.create()
Expand All @@ -42,7 +48,10 @@ def test_additional_code_create_valid_data(session_with_workbasket, date_ranges)
"start_date_1": date_ranges.normal.lower.month,
"start_date_2": date_ranges.normal.lower.year,
}
form = forms.AdditionalCodeCreateForm(data=data, request=session_with_workbasket)
form = forms.AdditionalCodeCreateForm(
data=data,
request=session_request_with_workbasket,
)

assert form.is_valid()
assert form.cleaned_data["additional_code_description"].description == "description"
Expand Down
8 changes: 4 additions & 4 deletions additional_codes/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def test_additional_codes_detail_views(
view,
url_pattern,
valid_user_client,
session_with_workbasket,
session_request_with_workbasket,
):
"""Verify that additional code detail views are under the url
additional_codes/ and don't return an error."""
Expand Down Expand Up @@ -228,7 +228,7 @@ def test_additional_code_details_list_no_measures(valid_user_client):
assert num_measures == 0


def test_additional_code_description_create(valid_user_client):
def test_additional_code_description_create(client_with_current_workbasket):
"""Tests that `AdditionalCodeDescriptionCreate` view returns 200 and creates
a description for the current version of an additional code."""
additional_code = factories.AdditionalCodeFactory.create()
Expand All @@ -250,10 +250,10 @@ def test_additional_code_description_create(valid_user_client):
}

with override_current_transaction(Transaction.objects.last()):
get_response = valid_user_client.get(url)
get_response = client_with_current_workbasket.get(url)
assert get_response.status_code == 200

post_response = valid_user_client.post(url, data)
post_response = client_with_current_workbasket.post(url, data)
assert post_response.status_code == 302

assert AdditionalCodeDescription.objects.filter(
Expand Down
11 changes: 11 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": [
"@babel/env",
[
"@babel/preset-react",
{
"runtime": "automatic" // defaults to classic
}
]
]
}
23 changes: 17 additions & 6 deletions certificates/tests/bdd/test_edit_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,24 @@

@pytest.fixture
@when("I edit certificate X000")
def model_edit_page(client, certificate_X000):
return client.get(certificate_X000.get_url("edit"))
def model_edit_page(client_with_current_workbasket, certificate_X000):
return client_with_current_workbasket.get(certificate_X000.get_url("edit"))


@pytest.fixture
@when("I edit certificate X000")
def model_edit_page_invalid_user(
client_with_current_workbasket_no_permissions,
certificate_X000,
):
return client_with_current_workbasket_no_permissions.get(
certificate_X000.get_url("edit"),
)


@then("I am not permitted to edit")
def edit_permission_denied(model_edit_page):
assert model_edit_page.status_code == 403
def edit_permission_denied(model_edit_page_invalid_user):
assert model_edit_page_invalid_user.status_code == 403


@then("I see an edit form")
Expand All @@ -26,8 +37,8 @@ def edit_permission_granted(model_edit_page):

@pytest.fixture
@when("I set the end date before the start date on certificate X000")
def end_date_before_start(client, response, certificate_X000):
response["response"] = client.post(
def end_date_before_start(client_with_current_workbasket, response, certificate_X000):
response["response"] = client_with_current_workbasket.post(
certificate_X000.get_url("edit"),
{
"start_date_0": "1",
Expand Down
24 changes: 12 additions & 12 deletions certificates/tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


def test_form_save_creates_new_certificate(
session_with_workbasket,
session_request_with_workbasket,
):
"""Tests that the certificate create form creates a new certificate, and
that two certificates of the same type are created with different sid's."""
Expand All @@ -35,7 +35,7 @@ def test_form_save_creates_new_certificate(
}
form = forms.CertificateCreateForm(
data=certificate_b_data,
request=session_with_workbasket,
request=session_request_with_workbasket,
)
certificate_b = form.save(commit=False)

Expand All @@ -45,7 +45,7 @@ def test_form_save_creates_new_certificate(


def test_certificate_type_does_not_increment_id(
session_with_workbasket,
session_request_with_workbasket,
):
"""Tests that when two certificates are made with different types, the sids
are not incremented."""
Expand Down Expand Up @@ -74,7 +74,7 @@ def test_certificate_type_does_not_increment_id(
for certificate in certificates:
form = forms.CertificateCreateForm(
data=certificate,
request=session_with_workbasket,
request=session_request_with_workbasket,
)
saved_certificate = form.save(commit=False)
completed_certificates.append(saved_certificate)
Expand All @@ -87,7 +87,7 @@ def test_certificate_type_does_not_increment_id(
assert completed_certificates[1].sid == "001"


def test_certificate_create_form_validates_data(session_with_workbasket):
def test_certificate_create_form_validates_data(session_request_with_workbasket):
"""A test to check that the create form validates data and ciphers out
incorrect submissions."""

Expand All @@ -101,7 +101,7 @@ def test_certificate_create_form_validates_data(session_with_workbasket):
}
form = forms.CertificateCreateForm(
data=certificate_data,
request=session_with_workbasket,
request=session_request_with_workbasket,
)
error_string = [
"Select a valid choice. That choice is not one of the available choices.",
Expand All @@ -119,7 +119,7 @@ def test_certificate_create_form_validates_data(session_with_workbasket):
assert not form.is_valid()


def test_certificate_create_with_custom_sid(session_with_workbasket):
def test_certificate_create_with_custom_sid(session_request_with_workbasket):
"""Tests that a certificate can be created with a custom sid inputted by the
user."""
certificate_type = factories.CertificateTypeFactory.create()
Expand All @@ -133,14 +133,14 @@ def test_certificate_create_with_custom_sid(session_with_workbasket):
}
form = forms.CertificateCreateForm(
data=data,
request=session_with_workbasket,
request=session_request_with_workbasket,
)
certificate = form.save(commit=False)

assert certificate.sid == "A01"


def test_certificate_create_ignores_non_numeric_sid(session_with_workbasket):
def test_certificate_create_ignores_non_numeric_sid(session_request_with_workbasket):
"""Tests that a certificate is created with a numeric sid when a certificate
of the same type with a non-numeric sid already exists."""
certificate_type = factories.CertificateTypeFactory.create()
Expand All @@ -154,14 +154,14 @@ def test_certificate_create_ignores_non_numeric_sid(session_with_workbasket):
}
form = forms.CertificateCreateForm(
data=data,
request=session_with_workbasket,
request=session_request_with_workbasket,
)
certificate = form.save(commit=False)

assert certificate.sid == "001"


def test_validation_error_raised_for_duplicate_sid(session_with_workbasket):
def test_validation_error_raised_for_duplicate_sid(session_request_with_workbasket):
"""Tests that a validation error is raised on create when a certificate of
the same type with the same sid already exists."""
certificate_type = factories.CertificateTypeFactory.create()
Expand All @@ -176,7 +176,7 @@ def test_validation_error_raised_for_duplicate_sid(session_with_workbasket):
}
form = forms.CertificateCreateForm(
data=data,
request=session_with_workbasket,
request=session_request_with_workbasket,
)

assert not form.is_valid()
Expand Down
Loading

0 comments on commit e10118a

Please sign in to comment.