Skip to content

Commit

Permalink
fix ruff related checks
Browse files Browse the repository at this point in the history
  • Loading branch information
vigo committed Aug 16, 2024
1 parent d041535 commit d258658
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.5
rev: v0.6.0
hooks:
- id: ruff
- repo: local
Expand Down
3 changes: 2 additions & 1 deletion tests/testproject/testapp/admin.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from django.contrib import admin

from dalf.admin import (
DALFChoicesField,
DALFModelAdmin,
DALFRelatedField,
DALFRelatedFieldAjax,
DALFRelatedOnlyField,
)
from django.contrib import admin

from .models import Category, Post, Tag

Expand Down
2 changes: 1 addition & 1 deletion tests/testproject/testapp/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
register(PostFactory)


@pytest.fixture()
@pytest.fixture
def posts():
return PostFactory.create_batch(10)
5 changes: 3 additions & 2 deletions tests/testproject/testapp/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
from http import HTTPStatus

import pytest
from dalf.admin import DALFChoicesField, DALFRelatedField, DALFRelatedFieldAjax, DALFRelatedOnlyField
from django.urls import reverse

from dalf.admin import DALFChoicesField, DALFRelatedField, DALFRelatedFieldAjax, DALFRelatedOnlyField

from .models import Post

csrf_token_pattern = re.compile(r'name="csrfmiddlewaretoken" value="([^"]+)"')


@pytest.mark.django_db()
@pytest.mark.django_db
def test_post_admin_filters_basics(admin_client, posts): # noqa: ARG001
posts_count = 10
post_authors = set(Post.objects.values_list('author__username', flat=True))
Expand Down

0 comments on commit d258658

Please sign in to comment.