Skip to content

Commit 4d7b45c

Browse files
committed
Improve unit test and add changelog entry
Signed-off-by: tdruez <[email protected]>
1 parent eca7e6a commit 4d7b45c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Release notes
22
=============
33

4+
### Version 5.5.0-dev
5+
6+
- Update ProductPackage "unknown" license during "Scan all Packages".
7+
Only "unknown" licenses are updated.
8+
Products with a is_locked configuration status are excluded.
9+
Inactive is_active=False products are excluded.
10+
https://github.com/aboutcode-org/dejacode/issues/388
11+
412
### Version 5.4.2
513

614
- Migrate the LDAP testing from using mockldap to slapdtest.

component_catalog/tests/test_models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1787,10 +1787,13 @@ def test_package_model_update_from_scan(self, mock_scio_update_from_scan, mock_i
17871787
self.dataspace.save()
17881788

17891789
mock_scio_update_from_scan.return_value = ["declared_license_expression"]
1790-
results = package1.update_from_scan(user=self.user, update_products=True)
1790+
results = package1.update_from_scan(user=self.user, update_products=False)
17911791
mock_scio_update_from_scan.assert_called()
17921792
self.assertEqual(["declared_license_expression"], results)
1793+
pp1.refresh_from_db()
1794+
self.assertEqual("unknown", pp1.license_expression)
17931795

1796+
results = package1.update_from_scan(user=self.user, update_products=True)
17941797
pp1.refresh_from_db()
17951798
self.assertEqual("mit", pp1.license_expression)
17961799

0 commit comments

Comments
 (0)