mirror of
https://github.com/jazzband/django-analytical.git
synced 2026-03-16 22:20:25 +00:00
Allow test suite to run with pytest
This commit is contained in:
parent
a9d7d17ce6
commit
bf471d7dfc
30 changed files with 35 additions and 31 deletions
|
|
@ -7,4 +7,4 @@ all_files = 1
|
|||
upload-dir = build/docs/html
|
||||
|
||||
[tool:pytest]
|
||||
DJANGO_SETTINGS_MODULE = analytical.tests.settings
|
||||
DJANGO_SETTINGS_MODULE = tests.testproject.settings
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Tests for the generic template tags and filters.
|
|||
from django.template import Context, Template
|
||||
|
||||
from analytical.templatetags import analytical
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
|
||||
|
||||
class AnalyticsTagTestCase(TagTestCase):
|
||||
|
|
@ -16,7 +16,7 @@ class AnalyticsTagTestCase(TagTestCase):
|
|||
def setUp(self):
|
||||
super().setUp()
|
||||
self._tag_modules = analytical.TAG_MODULES
|
||||
analytical.TAG_MODULES = ['analytical.tests.dummy']
|
||||
analytical.TAG_MODULES = ['tests.testproject.dummy']
|
||||
analytical.template_nodes = analytical._load_template_nodes()
|
||||
|
||||
def tearDown(self):
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from django.test.utils import override_settings
|
|||
|
||||
from analytical.templatetags.chartbeat import ChartbeatTopNode, \
|
||||
ChartbeatBottomNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.clickmap import ClickmapNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.clicky import ClickyNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.crazy_egg import CrazyEggNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from django.test import override_settings
|
|||
|
||||
from analytical.templatetags.analytical import _load_template_nodes
|
||||
from analytical.templatetags.facebook_pixel import FacebookPixelHeadNode, FacebookPixelBodyNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.gauges import GaugesNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from django.test.utils import override_settings
|
|||
from analytical.templatetags.google_analytics import GoogleAnalyticsNode, \
|
||||
TRACK_SINGLE_DOMAIN, TRACK_MULTIPLE_DOMAINS, TRACK_MULTIPLE_SUBDOMAINS,\
|
||||
SCOPE_VISITOR, SCOPE_SESSION, SCOPE_PAGE
|
||||
from analytical.tests.utils import TestCase, TagTestCase
|
||||
from utils import TestCase, TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.google_analytics_gtag import GoogleAnalyticsGTagNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from django.test.utils import override_settings
|
|||
|
||||
from analytical.templatetags.google_analytics_js import GoogleAnalyticsJsNode, \
|
||||
TRACK_SINGLE_DOMAIN, TRACK_MULTIPLE_DOMAINS, TRACK_MULTIPLE_SUBDOMAINS
|
||||
from analytical.tests.utils import TestCase, TagTestCase
|
||||
from utils import TestCase, TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.gosquared import GoSquaredNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from django.test import override_settings
|
|||
|
||||
from analytical.templatetags.analytical import _load_template_nodes
|
||||
from analytical.templatetags.hotjar import HotjarNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.hubspot import HubSpotNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.intercom import IntercomNode, intercom_user_hash
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.kiss_insights import KissInsightsNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.kiss_metrics import KissMetricsNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.matomo import MatomoNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.mixpanel import MixpanelNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.olark import OlarkNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.optimizely import OptimizelyNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.performable import PerformableNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.piwik import PiwikNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.rating_mailru import RatingMailruNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from analytical.templatetags.snapengage import SnapEngageNode, \
|
|||
BUTTON_STYLE_LIVE, BUTTON_STYLE_DEFAULT, BUTTON_STYLE_NONE, \
|
||||
BUTTON_LOCATION_LEFT, BUTTON_LOCATION_RIGHT, BUTTON_LOCATION_TOP, \
|
||||
BUTTON_LOCATION_BOTTOM, FORM_POSITION_TOP_LEFT
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.spring_metrics import SpringMetricsNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.uservoice import UserVoiceNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.woopra import WoopraNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from django.template import Context
|
|||
from django.test.utils import override_settings
|
||||
|
||||
from analytical.templatetags.yandex_metrica import YandexMetricaNode
|
||||
from analytical.tests.utils import TagTestCase
|
||||
from utils import TagTestCase
|
||||
from analytical.utils import AnalyticalException
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ from analytical.utils import (
|
|||
get_required_setting,
|
||||
is_internal_ip,
|
||||
)
|
||||
from analytical.tests.utils import TestCase
|
||||
from utils import TestCase
|
||||
|
||||
|
||||
class SettingDeletedTestCase(TestCase):
|
||||
|
|
@ -35,6 +35,10 @@ class MyUser(AbstractBaseUser):
|
|||
identity = models.CharField(max_length=50)
|
||||
USERNAME_FIELD = 'identity'
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
app_label = 'testapp'
|
||||
|
||||
|
||||
class GetIdentityTestCase(TestCase):
|
||||
def test_custom_username_field(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue