Fix missing tags causing errors in import with Postgres (#1203)

* Handle missing tags in importer

* Make all tests run with Postgres again
This commit is contained in:
Sascha Ißbrücker
2025-10-11 10:32:31 +02:00
committed by GitHub
parent 8b98a335d4
commit a6b36750da
3 changed files with 20 additions and 5 deletions

View File

@@ -1,13 +1,15 @@
import datetime
import email
import unittest
import urllib.parse
from django.conf import settings
from django.test import TestCase
from django.urls import reverse
from bookmarks.tests.helpers import BookmarkFactoryMixin
from bookmarks.models import FeedToken, User
from bookmarks.feeds import sanitize
from bookmarks.models import FeedToken, User
from bookmarks.tests.helpers import BookmarkFactoryMixin
def rfc2822_date(date):
@@ -343,6 +345,10 @@ class FeedsTestCase(TestCase, BookmarkFactoryMixin):
self.assertEqual(response.status_code, 200)
self.assertContains(response, "<item>", count=5)
@unittest.skipIf(
settings.LD_DB_ENGINE == "postgres",
"Postgres does not allow NUL in text columns",
)
def test_strip_control_characters(self):
self.setup_bookmark(
title="test\n\r\t\0\x08title", description="test\n\r\t\0\x08description"