Format and lint with ruff (#1263)

This commit is contained in:
Sascha Ißbrücker
2026-01-04 12:13:48 +01:00
committed by GitHub
parent 4d82fefa4e
commit 3b26190df5
178 changed files with 601 additions and 739 deletions

View File

@@ -1,23 +1,21 @@
import datetime
from typing import Type
from dateutil.relativedelta import relativedelta
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponse
from django.template import Template, RequestContext
from django.test import TestCase, RequestFactory
from django.template import RequestContext, Template
from django.test import RequestFactory, TestCase
from django.urls import reverse
from django.utils import timezone, formats
from django.utils import formats, timezone
from bookmarks.middlewares import LinkdingMiddleware
from bookmarks.models import Bookmark, BookmarkSearch, UserProfile, User
from bookmarks.models import Bookmark, BookmarkSearch, User, UserProfile
from bookmarks.tests.helpers import BookmarkFactoryMixin, HtmlTestMixin
from bookmarks.views import contexts
from bookmarks.utils import app_version
from bookmarks.views import contexts
class BookmarkListTemplateTest(TestCase, BookmarkFactoryMixin, HtmlTestMixin):
def assertBookmarksLink(
self, html: str, bookmark: Bookmark, link_target: str = "_blank"
):
@@ -262,7 +260,7 @@ class BookmarkListTemplateTest(TestCase, BookmarkFactoryMixin, HtmlTestMixin):
def render_template(
self,
url="/bookmarks",
context_type: Type[
context_type: type[
contexts.BookmarkListContext
] = contexts.ActiveBookmarkListContext,
user: User | AnonymousUser = None,
@@ -524,9 +522,7 @@ class BookmarkListTemplateTest(TestCase, BookmarkFactoryMixin, HtmlTestMixin):
user.profile.bookmark_date_display = UserProfile.BOOKMARK_DATE_DISPLAY_ABSOLUTE
user.profile.save()
date_added = timezone.datetime(
2023, 8, 11, 21, 45, 11, tzinfo=datetime.timezone.utc
)
date_added = timezone.datetime(2023, 8, 11, 21, 45, 11, tzinfo=datetime.UTC)
bookmark = self.setup_bookmark(
url="https://example.com/article", added=date_added
)