diff --git a/uvdat/core/models/project.py b/uvdat/core/models/project.py index 92c8a844..aab151f3 100644 --- a/uvdat/core/models/project.py +++ b/uvdat/core/models/project.py @@ -36,7 +36,7 @@ def followers(self): @transaction.atomic() def delete_users_perms(self, users: list[User]): - """Deletes all permissions a user may have on this project.""" + """Delete all permissions a user may have on this project.""" user_ids = [user.id for user in users] UserObjectPermission.objects.filter( content_type__app_label=self._meta.app_label, diff --git a/uvdat/core/rest/serializers.py b/uvdat/core/rest/serializers.py index c7500d63..de30f7cd 100644 --- a/uvdat/core/rest/serializers.py +++ b/uvdat/core/rest/serializers.py @@ -1,7 +1,6 @@ from django.contrib.auth.models import User from django.contrib.gis.geos import Point from django.contrib.gis.serializers import geojson -from guardian.shortcuts import get_users_with_perms from rest_framework import serializers from uvdat.core.models import ( diff --git a/uvdat/core/tests/conftest.py b/uvdat/core/tests/conftest.py index 238bd207..751a343b 100644 --- a/uvdat/core/tests/conftest.py +++ b/uvdat/core/tests/conftest.py @@ -5,7 +5,7 @@ from uvdat.core.models import Project -from .factory_fixtures import * # noqa: F403 +from .factory_fixtures import * # noqa: F403, F401 @pytest.fixture diff --git a/uvdat/core/tests/factories.py b/uvdat/core/tests/factories.py index 2f05d6cc..e0165e6c 100644 --- a/uvdat/core/tests/factories.py +++ b/uvdat/core/tests/factories.py @@ -12,7 +12,7 @@ class FuzzyPointField(factory.fuzzy.BaseFuzzyAttribute): - """Yields random point""" + """Yield random point.""" def __init__(self, **kwargs): super().__init__(**kwargs) diff --git a/uvdat/core/tests/test_dataset.py b/uvdat/core/tests/test_dataset.py index 31068f72..67552814 100644 --- a/uvdat/core/tests/test_dataset.py +++ b/uvdat/core/tests/test_dataset.py @@ -2,7 +2,7 @@ import pytest -from uvdat.core.models.networks import Network, NetworkEdge, NetworkNode +from uvdat.core.models.networks import Network, NetworkNode from uvdat.core.models.project import Dataset, Project @@ -81,7 +81,8 @@ def test_rest_dataset_gcc( dataset = network.dataset project.datasets.add(dataset) resp = authenticated_api_client.get( - f'/api/v1/datasets/{dataset.id}/gcc/?project={project.id}&exclude_nodes={connecting_node.id}' + f'/api/v1/datasets/{dataset.id}/gcc/' + f'?project={project.id}&exclude_nodes={connecting_node.id}' ) larger_group: list[NetworkNode] = max(group_a, group_b, key=len) @@ -109,7 +110,8 @@ def test_rest_dataset_map_layers_incorrect_layer_type( for _ in range(3): factory(dataset=dataset) - # Check that nothing is returned, since map_layers will only return map layers that match the dataset's type + # Check that nothing is returned, since map_layers will only + # return map layers that match the dataset's type resp = authenticated_api_client.get(f'/api/v1/datasets/{dataset.id}/map_layers/') assert resp.status_code == 200 assert resp.json() == []