Skip to content

Instantly share code, notes, and snippets.

@kezabelle
Created September 18, 2011 16:23
Show Gist options
  • Save kezabelle/1225233 to your computer and use it in GitHub Desktop.
Save kezabelle/1225233 to your computer and use it in GitHub Desktop.
test piece for django-cms issue #992
# tests/project/pluginapp/plugins/db_table/cms_plugins.py
from django.db import models
from cms.models import CMSPlugin
class NewPluginTestNoDefaults(CMSPlugin):
pass
class NewPluginTestAsPerDefaults(CMSPlugin):
class Meta:
# todo - use defaults
class NewPluginTestCustomisedAppLabel(CMSPlugin):
class Meta:
app_label = 'one_thing'
class NewPluginTestCustomisedDBTable(CMSPlugin):
class Meta:
db_table = 'or_another'
class NewPluginTestCustomisedBoth(CMSPlugin):
class Meta:
app_label = 'one_thing'
db_table = 'or_another'
@ojii
Copy link

ojii commented Oct 4, 2011

add the app to installed apps on runtime in your test method (using SettingsOverride) and then import models.py in the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment