Skip to content

Commit

Permalink
👌 - fix: pr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Roeland committed Dec 20, 2024
1 parent 9e5ea4a commit 71cacb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions backend/src/openarchiefbeheer/destruction/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,11 +449,11 @@ class Meta:
"deletable_items_count",
)

def get_deletable_items_count(self, instance) -> int:
def get_deletable_items_count(self, instance: DestructionList) -> int:
succeeded_count = instance.items.filter(
processing_status=InternalStatus.succeeded
).count()
total_count = instance.items.all().count()
total_count = instance.items.filter(status=ListItemStatus.suggested).count()
return total_count - succeeded_count


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
from openarchiefbeheer.utils.tests.e2e import browser_page
from openarchiefbeheer.utils.tests.gherkin import GherkinLikeTestCase

from ....constants import InternalStatus, ListStatus
from ....constants import InternalStatus, ListItemStatus, ListStatus


@tag("e2e")
@tag("gh-568")
class Issue568CorrectCount(GherkinLikeTestCase):
async def test_destruction_fails_with_incorrect_count(self):
async with browser_page() as page:
zaken = await self.given.zaken_are_indexed(amount=5)
zaken = await self.given.zaken_are_indexed(amount=6)
await self.given.record_manager_exists()

destruction_list = await self.given.list_exists(
Expand Down Expand Up @@ -45,6 +45,12 @@ async def test_destruction_fails_with_incorrect_count(self):
processing_status=InternalStatus.succeeded,
zaak=zaken[4],
)
await self.given.list_item_exists(
destruction_list=destruction_list,
status=ListItemStatus.removed,
processing_status=InternalStatus.new,
zaak=zaken[5],
)

await self.when.record_manager_logs_in(page)
await self.then.path_should_be(page, "/destruction-lists")
Expand Down

0 comments on commit 71cacb0

Please sign in to comment.