mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-12 09:37:04 +01:00
Reduces number of warnings from testing from 165 to 128. In doing so, fixes a few minor things in the decrypt and export commands
This commit is contained in:
parent
96a84d16a6
commit
85b210ebf6
6 changed files with 24 additions and 14 deletions
|
|
@ -61,6 +61,6 @@ class TestDocumentAdmin(DirectoriesMixin, TestCase):
|
|||
|
||||
def test_created(self):
|
||||
doc = Document.objects.create(
|
||||
title="test", created=timezone.datetime(2020, 4, 12)
|
||||
title="test", created=timezone.make_aware(timezone.datetime(2020, 4, 12))
|
||||
)
|
||||
self.assertEqual(self.doc_admin.created_(doc), "2020-04-12")
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from unittest import mock
|
|||
import pytest
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.utils import timezone
|
||||
from django.test import override_settings
|
||||
from rest_framework.test import APITestCase
|
||||
from whoosh.writing import AsyncWriter
|
||||
|
|
@ -567,11 +568,15 @@ class TestDocumentApi(DirectoriesMixin, APITestCase):
|
|||
d3.tags.add(t)
|
||||
d3.tags.add(t2)
|
||||
d4 = Document.objects.create(
|
||||
checksum="4", created=datetime.datetime(2020, 7, 13), content="test"
|
||||
checksum="4",
|
||||
created=timezone.datetime(2020, 7, 13),
|
||||
content="test",
|
||||
)
|
||||
d4.tags.add(t2)
|
||||
d5 = Document.objects.create(
|
||||
checksum="5", added=datetime.datetime(2020, 7, 13), content="test"
|
||||
checksum="5",
|
||||
added=timezone.datetime(2020, 7, 13),
|
||||
content="test",
|
||||
)
|
||||
d6 = Document.objects.create(checksum="6", content="test2")
|
||||
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ class TestMatching(TestCase):
|
|||
def test_match_regex(self):
|
||||
|
||||
self._test_matching(
|
||||
"alpha\w+gamma",
|
||||
r"alpha\w+gamma",
|
||||
"MATCH_REGEX",
|
||||
(
|
||||
"I have alpha_and_gamma in me",
|
||||
|
|
@ -181,7 +181,7 @@ class TestMatching(TestCase):
|
|||
)
|
||||
|
||||
def test_tach_invalid_regex(self):
|
||||
self._test_matching("[[", "MATCH_REGEX", [], ["Don't match this"])
|
||||
self._test_matching("[", "MATCH_REGEX", [], ["Don't match this"])
|
||||
|
||||
def test_match_fuzzy(self):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue