-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add goods on licences endpoint #2307
Add goods on licences endpoint #2307
Conversation
1553cc8
to
585ef1d
Compare
@pytest.fixture(autouse=True) | ||
def mock_s3(): | ||
with mock_aws(): | ||
s3 = init_s3_client() | ||
s3.create_bucket( | ||
Bucket=settings.AWS_STORAGE_BUCKET_NAME, | ||
CreateBucketConfiguration={ | ||
"LocationConstraint": settings.AWS_REGION, | ||
}, | ||
) | ||
yield | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was already moved into conftest.py
which is why it doesn't need to be here https://github.com/uktrade/lite-api/blob/dev/api/data_workspace/v2/tests/bdd/conftest.py#L67-L77
# create final advice for controlled goods; skip NLR goods | ||
if good_on_app.is_good_controlled == False: | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a new thing I added, otherwise it's the same fixture just moved to conftest.py
451202d
to
807d0a0
Compare
class GoodOnLicenceViewSet(BaseViewSet): | ||
serializer_class = GoodOnLicenceSerializer | ||
queryset = GoodOnLicence.objects.exclude( | ||
licence__case__status__status=CaseStatusEnum.DRAFT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in practice it would be pretty unusual to have a licence with a GoodOnLicence object and a case status DRAFT, so I considered removing this filtering licence__case__status__status=CaseStatusEnum.DRAFT
, but ultimately I didn't want to change the queryset from the prototype which has been validated so it stayed in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Worth considering though. View full project report here.
data[f"quantity-{good_on_app.id}"] = str(good_on_app.quantity) | ||
data[f"value-{good_on_app.id}"] = str(good_on_app.value) | ||
# create final advice for controlled goods; skip NLR goods | ||
if good_on_app.is_good_controlled == False: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if good_on_app.is_good_controlled == False: | |
if good_on_app.is_good_controlled is False: |
False
is a singleton data type, so should be compared using is
. More info.
@given(parsers.parse("the goods are assessed by TAU as:{assessments}")) | ||
def the_goods_are_assessed_by_tau_as( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is there in test_goods_descriptions.py
and can be moved to conftest.py
LTD-5674