summaryrefslogtreecommitdiff
path: root/ishtar_common/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2024-10-16 15:28:48 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2025-02-19 14:43:48 +0100
commitb8eef9b6aaed7ee097f8ea86174067f9ca42abd8 (patch)
treea4befe6351f6992a42482343f50f5c7b5fe4a2ea /ishtar_common/tests.py
parente0a3b8644c35ccc7635d16a423ba71526b4d8f3b (diff)
downloadIshtar-b8eef9b6aaed7ee097f8ea86174067f9ca42abd8.tar.bz2
Ishtar-b8eef9b6aaed7ee097f8ea86174067f9ca42abd8.zip
✅ fix tests
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r--ishtar_common/tests.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index f9c928d5e..2a8983048 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -17,16 +17,13 @@
# See the file COPYING for details.
from bs4 import BeautifulSoup as Soup
-import re
import csv
-import copy
import datetime
import importlib
import io
import json
import os
import shutil
-import sys
import tempfile
from time import time
import zipfile
@@ -56,7 +53,7 @@ from django.core.management import call_command
from django.db.models.fields import BooleanField
from django.db.models.fields.related import ForeignKey
from django.template.defaultfilters import slugify
-from django.test import tag, TestCase as BaseTestCase
+from django.test import TestCase as BaseTestCase
from django.test.client import Client
from django.test.runner import DiscoverRunner
from django.utils.translation import ugettext_lazy as _
@@ -65,7 +62,6 @@ from django.urls import reverse
from ishtar_common import models, models_common, forms_common
from ishtar_common import views
from ishtar_common.apps import admin_site
-from ishtar_common.models_imports import Import, ImporterType
from ishtar_common.serializers import (
type_serialization,
SERIALIZATION_VERSION,
@@ -2236,7 +2232,7 @@ class ShortMenuTest(TestCase):
self.other_user = User.objects.create_superuser(
"John", "nomail@nomail.com", self.password
)
- profile = models.get_current_profile()
+ profile = models.get_current_profile(force=True)
profile.files = True
profile.context_record = True
profile.find = True
@@ -3402,9 +3398,11 @@ class IshtarSiteProfileTest(TestCase):
cache.set(
"default-ishtar_common-IshtarSiteProfile", None, settings.CACHE_TIMEOUT
)
- self.assertFalse(models.IshtarSiteProfile.objects.count())
+ for isp in models.IshtarSiteProfile.objects.all():
+ isp.delete()
profile = models.get_current_profile(force=True)
self.assertTrue(profile)
+ self.assertTrue(profile.active)
self.assertEqual(models.IshtarSiteProfile.objects.count(), 1)
def test_menu_filtering(self):
@@ -3425,7 +3423,7 @@ class IshtarSiteProfileTest(TestCase):
self.assertIn(b'href="/file_search/"', response.content)
def testExternalKey(self):
- profile = models.get_current_profile()
+ profile = models.get_current_profile(force=True)
p = models.Person.objects.create(name="plouf", surname="Tégada")
self.assertEqual(p.raw_name, "PLOUF Tégada")
profile.person_raw_name = "{surname|slug} {name}"