Skip to content

Commit

Permalink
[-] Updated test settings to test generic relations
Browse files Browse the repository at this point in the history
  • Loading branch information
coordt committed Oct 13, 2017
1 parent 9c5ccb8 commit dd23a2d
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions example/settings-testing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Django settings for sample project.
import os
import sys
import django

APP = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
PROJ_ROOT = os.path.abspath(os.path.dirname(__file__))
Expand Down Expand Up @@ -96,5 +95,23 @@
},
]

if django.VERSION[1] > 5:
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
CATEGORIES_SETTINGS = {
'ALLOW_SLUG_CHANGE': True,
'RELATION_MODELS': ['simpletext.simpletext', 'flatpages.flatpage'],
'FK_REGISTRY': {
'flatpages.flatpage': 'category',
'simpletext.simpletext': (
'primary_category',
{'name': 'secondary_category', 'related_name': 'simpletext_sec_cat'},
),
},
'M2M_REGISTRY': {
# 'simpletext.simpletext': {'name': 'categories', 'related_name': 'm2mcats'},
'flatpages.flatpage': (
{'name': 'other_categories', 'related_name': 'other_cats'},
{'name': 'more_categories', 'related_name': 'more_cats'},
),
},
}

TEST_RUNNER = 'django.test.runner.DiscoverRunner'

0 comments on commit dd23a2d

Please sign in to comment.