Package: django-cms-tools
Miscellaneous tools/helpers for django CMS.Look also at the siblings project:django-tools(Tools/helpers around Django).travis-ci.org/jedie/django-cms-toolscodecov.io/gh/jedie/django-toolscoveralls.io/r/jedie/django-cms-toolslandscape.io/github/jedie/django-cms-tools/masterexisting stuffDjango-CMS pluginspage anchor menuAdd a anchor menu to a CMS page.
More info in:django_cms_tools/plugin_anchor_menu/README.creolelanding pageA app to create landing pages.
More info in:django_cms_tools/plugin_landing_page/README.creoleTest utilitiesAdd CMS Plugin unittest test casedjango_cms_tools.unittest_utils.add_cms_plugin.TestAddPluginTestCase- TestCase to test “add CMS plugin via admin”Generate Add CMS Plugin unittest skeletone.g.:$ ./manage.py generate_add_plugin_test_code plugin_anchor_menu.AnchorPlugin

from django_cms_tools.unittest_utils.add_cms_plugin import TestAddPluginTestCase

class AddPluginTestCase(TestAddPluginTestCase):
    """
    Tests for plugin_anchor_menu.AnchorPluginModel

    Based on a skeleton generated via:
        ./manage.py generate_add_plugin_test_code plugin_anchor_menu.AnchorPlugin
    """

    def test_anchorplugin_de_1(self):
        # plugin name in de: 'Anchor'
        self.create_plugin(
            language_code = "de",
            plugin_parent=None,
            plugin_type="AnchorPlugin",

            title='dummy text no. 0', # CharField, String (up to 254)
            slug='dummy-text-no-0', # SlugField, Slug (up to 255)
        )
        response = self.assert_plugin(
            language_code="de",
            must_contain_html=[
                "<XXX></XXX>", # TODO: Add plugin html output here!
            ],
            must_contain=[
                "dummy text no. 0",
            ],
            template_name="anchor_menu/anchor.html",
        )

    def test_anchorplugin_de_2(self):
...Display usage of a CMS-PluginList all existing plugins by calling:./manage.py list_page_by_pluginTo display CMS-Plugin usage, add the plugin name as argument, e.g.:./manage.py list_page_by_plugin TextPluginCMS related test assertmentsdjango_cms_tools.unittest_utils.assertmentscontains CMS related test assertments:assert_public_cms_app_namespaces()- Check if given namespaces exists.assert_public_cms_page_urls()- Check if given urls exist.test fixture creationdjango_cms_tools.fixtures.pagesHelper for creating Django CMS pages in test fixtures:Classdjango_cms_tools.fixtures.pages.***CmsPageCreator*can be used for create normal/plugin CMS pages.
Inherit from the class and overwrite attributes/methods for your need ;)
Example, look into the Test code.Source:django_cms_tools/fixtures/pages.pyTest/Example:/tests/test_fixtures_pages.pycreate_cms_index_pagesCreate CMS home page in all existing languages (settings.LANGUAGES) and fill placeholder with TextPlugin, use:django_cms_tools.fixtures.pages.***create_cms_index_pages*create_cms_plugin_pageCreate CMS plugin page in all existing languages (settings.LANGUAGES) and add a link to the index page.django_cms_tools.fixtures.pages.***create_cms_plugin_page*django filer toolsexperimentalActivate by change your settings.py, e.g.:INSTALLED_APPS = [
    ...
    'django_cms_tools.filer_tools',
    ...
]‘image info’ management commandDisplay information about the number of existing, missing and ignored images. And a summary about all used images.
usage:$ ./manage.py image_info

34 items - foo.Bar
34 instanced checked:
   0 exist    0 missing   34 ignored - foo.BarModel.meta_image
  34 exist    0 missing    0 ignored - foo.BarModel.filer_overview_image

...

total:
    existing images..: 6171
    missing images...: 0
-------------------------------------------------------------------------------
Collect all filer IDs...
File: 2 entries
Image: 2 entries
Information about File:
    Total entry count: 8042 entries.
    Used entry count: 2 entries.
    Total size: 13.8 GB
    Used size: 997.5 KB
Information about Image:
    Total entry count: 6993 entries.
    Used entry count: 2 entries.
    Total size: 13.7 GB
    Used size: 997.5 KB
(Note: 'File' contains 'Image' ;)‘replace broken’ management commandReplace all not existing files files with a given filer ID.e.g.: You would like to make a clone of a existing installation, but without to move the real files:make a DB dump on the source systeminsert the DB dump the the cloned systemlog into django admin of the new cloned versionupload a “dummy.jpg” filer imagewrite down the filer image ID (e.g.: 123)start:$ ./manage.py replace_broken 123filer ‘export_filer_images’ management commandTheexport_filer_imagesstores all used filer image files to disk. e.g.:$ ./manage.py export_filer_images my_backups‘template_info’ management commandActivate e.g.:INSTALLED_APPS = [
    ...
    'django_cms_tools',
    ...
]It looks like:$ ./manage.py template_info

There are 3 public pages:
pk:1 /en/                                     /foo/homepage.html
pk:2 /en/foo/                                 INHERIT
pk:3 /en/foo/bar/                             INHERIT‘cms_plugin_info’ management commandActivate e.g.:INSTALLED_APPS = [
    ...
    'django_cms_tools',
    ...
]It looks like:$ ./manage.py cms_plugin_info

There are 4 CMS plugins:
'Django CMS Tools Test'
    * RelatedPlugin (Related Plugin)
'Generic'
    * PlaceholderPlugin (Placeholder)
    * AliasPlugin (Alias)
    * TextPlugin (Text)run test project.../django-cms-tools$ ./run_test_project_dev_server.shor:.../django-cms-tools$ cd django_cms_tools_test_project/
.../django-cms-tools/django_cms_tools_test_project$ ./manage.py run_test_project_dev_serverrunning testsRun all tests in all environment combinations via tox:$ python3 setup.py toxRun all tests in current environment via pytest:$ python3 setup.py testDjango compatibilitydjango-cms-toolsDjango CMSdjango versionpython>=v0.63.4.xv1.113.5, 3.6, pypy3>=v0.5.13.4.x1.8, v1.113.5, 3.6, pypy3v0.4.01.82.7, 3.5, 3.6v0.1.x1.82.7, 3.4, 3.5Currently Django CMS v3.5 is not supported, yet.
It’s on the TODO, see:issues #1(See also combinations in.travis.ymlandtox.ini)TODO:Add tests for ‘filer commands’Support Django CMS v3.5 and run tests against these versions.Support Django v2.0 and run tests against these versions.Backwards-incompatible changesv0.7django_cms_tools.fixturesrenamed to:django_cms_tools.fixture_helperremovedjango_cms_tools.fixtures.languageshistorydev-compare v0.7.0…masterv0.7.1 - 30.07.2019 -compare v0.7.0…v0.7.1Add “landing page” migrations because ofdjango-parler v2.0 changesv0.7.0 - 18.09.2018 -compare v0.6.11…v0.7.0django_cms_tools.fixturesrenamed to:django_cms_tools.fixture_helperremovedjango_cms_tools.fixtures.languagesNEW:django_cms_tools.unittest_utils.assertmentsv0.6.11 - 21.06.2018 -compare v0.6.10…v0.6.11Bugfix CmsPageCreator if create process will try to find the published page instancev0.6.10 - 05.06.2018 -compare v0.6.9…v0.6.10NEW: management command: ‘export_filer_images’ to store all filer images on diskBugfixdjango_cms_tools.filer_tools.helper.collect_all_filer_idsifdefault_model_classis a stringv0.6.9 - 04.05.2018 -compare v0.6.8…v0.6.9Enhance ‘Generate ‘add cms plugin’ skeleton code’v0.6.8 - 25.04.2018 -compare v0.6.7…v0.6.8NEW: Display usage of a CMS-Plugin by:./manage.py list_page_by_pluginChange increate_plugin()the**plugin_kwargsargument topost_datav0.6.7 - 24.04.2018 -compare v0.6.6…v0.6.7NEW: Generate ‘add cms plugin’ skeleton code with./manage.py generate_add_plugin_test_codev0.6.6 - 09.04.2018 -compare v0.6.5…v0.6.6NEW:./manage.py orphaned_plugin_infoto get a list about Django CMS uninstalled/unsaved pluginsv0.6.5 - 22.03.2018 -compare v0.6.4…v0.6.5UseParlerDummyGenerator(for landing page test fixtures) from django-toolsdjango_cms_tools.fixtures.languages.iter_languageswas moved to django-tools!Bugfix: DummyPageGenerator creates non-published pagesv0.6.4 - 06.03.2018 -compare v0.6.3…v0.6.4Updatedjango_cms_tools.fixtures.pages.DummyPageGeneratorto changes APIv0.6.3 - 23.02.2018 -compare v0.6.2…v0.6.3Rename landing page and anchor menu plugins via django.apps.AppConfigUpdate publisher itegration testsv0.6.2 - 22.02.2018 -compare v0.6.1…v0.6.2Bugfix packaging: Include template filesv0.6.1 - 22.02.2018 -compare v0.6.0…v0.6.1Update “landing page” plugin to new publisher APIv0.6.0 - 20.02.2018 -compare v0.5.2…v0.6.0remove test runs with Django v1.8NEW: Django-CMS plugin for create “landing pages”NEW: Django-CMS plugin for build a page anchor menuNEW:./manage.py cms_plugin_infoto generate a list of all registered Django CMS pluginsv0.5.2 - 10.01.2018 -compare v0.5.1…v0.5.2enhance and bugfix ‘replace_broken’ commandv0.5.1 - 21.12.2017 -compare v0.5.0…v0.5.1refactor travis/tox/pytest/coverage stuffTests can be run viapython3 setup.py toxand/orpython3 setup.py testTest also with pypy3 on Travis CI.v0.5.0 - 19.12.2017 -compare v0.4.0…v0.5.0Skip official support for python v2 (remove from text matrix)NEW:./manage.py template_infoNEW:./manage.py cms_page_infoCmsPageCreator API changed:the stringCmsPageCreator.placeholder_slotchanged to iterableCmsPageCreator.placeholder_slotsaddplaceholderargument inCmsPageCreator.get_dummy_text()andCmsPageCreator.get_add_plugin_kwargs()Bugfix: use always drafts as parent pages (see also:https://github.com/divio/django-cms/pull/6126)add unittestsv0.4.0 - 18.09.2017 -compare v0.3.2…v0.4.0NEW:django_cms_tools.models.RelatedPluginModelMixinNEW:DummyPageGeneratorNEW:ModelPermissionMixinmisc updates/changesv0.3.2 - 22.05.2017 -compare v0.3.1…v0.3.2Bugfix in{% el_pagination_placeholder %} and render all plugins after the tag.v0.3.1 - 04.05.2017 -compare v0.3.0…v0.3.1Bugfix inCmsPageCreator: evaluate lazy “language name” translation in the right language (e.g.: e.g.:settings.LANGUAGE_CODEis not “en”)v0.3.0 - 27.04.2017 -compare v0.2.0…v0.3.0NEW:django_cms_tools.fixtures.pages.***CmsPageCreator*for creating Django CMS pages in test fixturesv0.2.0 - 10.04.2017 -compare v0.1.2…v0.2.0Experimental: Filer management commands: ‘image_info’ and ‘replace_broken’v0.1.2 - 28.03.2017 -compare v0.1.1…v0.1.2Change: create pages with translated language namev0.1.1 - 27.03.2017 -compare v0.1.0…v0.1.1Fix pypi package stuffv0.1.0 - 27.03.2017NEW: create_cms_index_pagesNEW: create_cms_plugin_pagelinksHomepagehttp://github.com/jedie/django-cms-toolsPyPihttps://pypi.org/project/django-cms-tools/donationpaypal.me/JensDiemerFlattr This!SendBitcoinsto1823RZ5Md1Q2X5aSXRC5LRPcYdveCiVX6F