mirror of
https://github.com/sissbruecker/linkding.git
synced 2026-03-07 02:13:12 +08:00
Format and lint with ruff (#1263)
This commit is contained in:
@@ -2,8 +2,8 @@ from django.test import override_settings
|
||||
from django.urls import reverse
|
||||
from playwright.sync_api import expect
|
||||
|
||||
from bookmarks.tests_e2e.helpers import LinkdingE2ETestCase
|
||||
from bookmarks.models import Bookmark
|
||||
from bookmarks.tests_e2e.helpers import LinkdingE2ETestCase
|
||||
|
||||
|
||||
class BookmarkDetailsModalE2ETestCase(LinkdingE2ETestCase):
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from django.urls import reverse
|
||||
from playwright.sync_api import expect
|
||||
|
||||
from bookmarks.tests_e2e.helpers import LinkdingE2ETestCase
|
||||
from bookmarks.models import Bookmark
|
||||
from bookmarks.tests_e2e.helpers import LinkdingE2ETestCase
|
||||
|
||||
|
||||
class BookmarkPageBulkEditE2ETestCase(LinkdingE2ETestCase):
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from typing import List
|
||||
|
||||
from django.urls import reverse
|
||||
from playwright.sync_api import expect
|
||||
|
||||
@@ -23,7 +21,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
|
||||
user=self.setup_user(enable_sharing=True),
|
||||
)
|
||||
|
||||
def assertVisibleBookmarks(self, titles: List[str]):
|
||||
def assertVisibleBookmarks(self, titles: list[str]):
|
||||
bookmark_tags = self.page.locator("ul.bookmark-list > li")
|
||||
expect(bookmark_tags).to_have_count(len(titles))
|
||||
|
||||
@@ -31,7 +29,7 @@ class BookmarkPagePartialUpdatesE2ETestCase(LinkdingE2ETestCase):
|
||||
matching_tag = bookmark_tags.filter(has_text=title)
|
||||
expect(matching_tag).to_be_visible()
|
||||
|
||||
def assertVisibleTags(self, titles: List[str]):
|
||||
def assertVisibleTags(self, titles: list[str]):
|
||||
tag_tags = self.page.locator(".tag-cloud .unselected-tags a")
|
||||
expect(tag_tags).to_have_count(len(titles))
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class BookmarkItemE2ETestCase(LinkdingE2ETestCase):
|
||||
page = self.open(reverse("linkding:bundles.new"))
|
||||
|
||||
expect(
|
||||
page.get_by_text(f"Found 6 bookmarks matching this bundle")
|
||||
page.get_by_text("Found 6 bookmarks matching this bundle")
|
||||
).to_be_visible()
|
||||
self.assertVisibleBookmarks(group1 + group2)
|
||||
|
||||
@@ -22,7 +22,7 @@ class BookmarkItemE2ETestCase(LinkdingE2ETestCase):
|
||||
search.fill("foo")
|
||||
|
||||
expect(
|
||||
page.get_by_text(f"Found 3 bookmarks matching this bundle")
|
||||
page.get_by_text("Found 3 bookmarks matching this bundle")
|
||||
).to_be_visible()
|
||||
self.assertVisibleBookmarks(group1)
|
||||
|
||||
@@ -30,7 +30,7 @@ class BookmarkItemE2ETestCase(LinkdingE2ETestCase):
|
||||
search.fill("bar")
|
||||
|
||||
expect(
|
||||
page.get_by_text(f"Found 3 bookmarks matching this bundle")
|
||||
page.get_by_text("Found 3 bookmarks matching this bundle")
|
||||
).to_be_visible()
|
||||
self.assertVisibleBookmarks(group2)
|
||||
|
||||
@@ -38,7 +38,7 @@ class BookmarkItemE2ETestCase(LinkdingE2ETestCase):
|
||||
search.fill("invalid")
|
||||
|
||||
expect(
|
||||
page.get_by_text(f"No bookmarks match the current bundle")
|
||||
page.get_by_text("No bookmarks match the current bundle")
|
||||
).to_be_visible()
|
||||
self.assertVisibleBookmarks([])
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ from bookmarks.tests_e2e.helpers import LinkdingE2ETestCase
|
||||
|
||||
|
||||
class CollapseSidePanelE2ETestCase(LinkdingE2ETestCase):
|
||||
|
||||
def setUp(self) -> None:
|
||||
super().setUp()
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ from unittest.mock import patch
|
||||
from django.urls import reverse
|
||||
from playwright.sync_api import expect
|
||||
|
||||
from bookmarks.tests_e2e.helpers import LinkdingE2ETestCase
|
||||
from bookmarks.services import website_loader
|
||||
from bookmarks.tests_e2e.helpers import LinkdingE2ETestCase
|
||||
|
||||
mock_website_metadata = website_loader.WebsiteMetadata(
|
||||
url="https://example.com",
|
||||
@@ -15,7 +15,6 @@ mock_website_metadata = website_loader.WebsiteMetadata(
|
||||
|
||||
|
||||
class BookmarkFormE2ETestCase(LinkdingE2ETestCase):
|
||||
|
||||
def setUp(self) -> None:
|
||||
super().setUp()
|
||||
self.website_loader_patch = patch.object(
|
||||
|
||||
@@ -17,7 +17,6 @@ mock_website_metadata = website_loader.WebsiteMetadata(
|
||||
|
||||
|
||||
class BookmarkFormE2ETestCase(LinkdingE2ETestCase):
|
||||
|
||||
def setUp(self) -> None:
|
||||
super().setUp()
|
||||
self.website_loader_patch = patch.object(
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from django.urls import reverse
|
||||
from playwright.sync_api import expect
|
||||
|
||||
from bookmarks.tests_e2e.helpers import LinkdingE2ETestCase
|
||||
from bookmarks.models import UserProfile
|
||||
from bookmarks.tests_e2e.helpers import LinkdingE2ETestCase
|
||||
|
||||
|
||||
class SettingsGeneralE2ETestCase(LinkdingE2ETestCase):
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import os
|
||||
|
||||
from django.contrib.staticfiles.testing import LiveServerTestCase
|
||||
from playwright.sync_api import BrowserContext, Page, sync_playwright
|
||||
from playwright.sync_api import expect
|
||||
from playwright.sync_api import BrowserContext, Page, expect, sync_playwright
|
||||
|
||||
from bookmarks.tests.helpers import BookmarkFactoryMixin
|
||||
|
||||
|
||||
Reference in New Issue
Block a user