From c74876f34dfa069031da70f876a5bda5712278f3 Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Mon, 30 Oct 2023 12:53:38 +0100 Subject: [PATCH] models:file - remove File.id --- acacore/models/file.py | 1 - tests/test_database.py | 2 -- 2 files changed, 3 deletions(-) diff --git a/acacore/models/file.py b/acacore/models/file.py index 6f83319..9ed7ee7 100644 --- a/acacore/models/file.py +++ b/acacore/models/file.py @@ -34,7 +34,6 @@ class Action(Enum): class File(ACABase): """File data model.""" - id: int = Field(primary_key=True) # noqa: A003 uuid: UUID4 = Field(primary_key=True) checksum: str puid: Optional[str] diff --git a/tests/test_database.py b/tests/test_database.py index aecb6ce..0853556 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -1,6 +1,5 @@ from hashlib import sha256 from pathlib import Path -from random import randint from uuid import uuid4 import pytest @@ -27,7 +26,6 @@ def test_file(test_files: Path, test_files_data: dict[str, dict]) -> File: filename, filedata = next(iter(test_files_data.items())) file: Path = test_files / filename return File( - id=randint(1, 10000), uuid=uuid4(), checksum=sha256(file.read_bytes()).hexdigest(), puid=filedata["matches"]["id"],