views:

101

answers:

1

I am trying to get some test coverage for a Django-CMS implementation I'm working on and I'm unsure how to unit test plugins/extensions. Has anyone done this before, and if so, how? Some examples would be awesome.

+1  A: 

If I understand your question correctly, you can find examples for unit-tests for plugins in the module cms/tests/plugins.py, located in the folder holding your installation of django-cms.

Basically you subclass CMSTestCase and use the Client class from django.test.client to make requests to your CMS and check the resulting responses.

Information on how to use the client can be found on http://docs.djangoproject.com/en/dev/topics/testing/#module-django.test.client

Florian Ilgenfritz