Permalink
Browse files

almost there

  • Loading branch information...
fivethreeo committed Feb 2, 2011
1 parent 89e9c7e commit 6d69bc574ba58dbec2415056d6f3fcb562959824
Showing with 66 additions and 65 deletions.
  1. +1 −1 cms/test/apps/fakemlng/models.py
  2. +1 −1 cms/test/apps/placeholderapp/admin.py
  3. +1 −1 cms/test/apps/pluginapp/models.py
  4. +3 −3 cms/test/apps/pluginapp/plugins/manytomany_rel/cms_plugins.py
  5. +2 −2 cms/test/apps/pluginapp/plugins/manytomany_rel/models.py
  6. +2 −2 cms/test/apps/sampleapp/admin.py
  7. +3 −3 cms/test/apps/sampleapp/cms_app.py
  8. +1 −1 cms/test/apps/sampleapp/menu.py
  9. +1 −1 cms/test/apps/sampleapp/models.py
  10. +1 −1 cms/test/apps/sampleapp/urls.py
  11. +2 −2 cms/test/apps/sampleapp/views.py
  12. +1 −1 cms/test/js_testcases.py
  13. +1 −1 cms/test/project/cms_urls_for_apphook_tests.py
  14. +1 −1 cms/test/project/noadmin_urls.py
  15. +1 −1 cms/test/project/nonroot_urls.py
  16. +1 −1 cms/test/project/second_cms_urls_for_apphook_tests.py
  17. +2 −2 cms/test/project/second_urls_for_apphook_tests.py
  18. +8 −8 cms/test/project/settings.py
  19. +1 −1 cms/test/project/testrunner.py
  20. +1 −1 cms/test/project/urls.py
  21. +2 −2 cms/test/project/urls_for_apphook_tests.py
  22. +1 −1 cms/test/util/context_managers.py
  23. +1 −1 cms/test/util/mock.py
  24. +1 −1 cms/tests/__init__.py
  25. +1 −1 cms/tests/admin.py
  26. +6 −6 cms/tests/apphooks.py
  27. +1 −1 cms/tests/docs.py
  28. +1 −1 cms/tests/forms.py
  29. +1 −1 cms/tests/javascript.py
  30. +1 −1 cms/tests/mail.py
  31. +1 −1 cms/tests/menu.py
  32. +1 −1 cms/tests/middleware.py
  33. +1 −1 cms/tests/multilingual.py
  34. +1 −1 cms/tests/nonroot.py
  35. +1 −1 cms/tests/page.py
  36. +3 −3 cms/tests/placeholder.py
  37. +2 −2 cms/tests/plugins.py
  38. +1 −1 cms/tests/settings.py
  39. +1 −1 cms/tests/urlutils.py
  40. +2 −2 cms/tests/views.py
  41. +1 −0 setup.py
@@ -11,4 +11,4 @@ class Translations(models.Model):
placeholder = PlaceholderField('translated', null=True)
class Meta:
- unique_together = [('master', 'language_code')]
+ unique_together = [('master', 'language_code')]
@@ -1,6 +1,6 @@
from django.contrib import admin
from cms.admin.placeholderadmin import PlaceholderAdmin
-from testapp.placeholderapp.models import *
+from cms.test.apps.placeholderapp.models import *
class MixinAdmin(admin.ModelAdmin):
@@ -12,4 +12,4 @@ class Article(models.Model):
section = models.ForeignKey(Section)
def __unicode__(self):
- return u"%s -- %s" % (self.title, self.section)
+ return u"%s -- %s" % (self.title, self.section)
@@ -3,8 +3,8 @@
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
-from testapp.pluginapp.plugins.manytomany_rel.models import ArticlePluginModel
-from testapp.pluginapp.models import Article
+from cms.test.apps.pluginapp.plugins.manytomany_rel.models import ArticlePluginModel
+from cms.test.apps.pluginapp.models import Article
@@ -21,4 +21,4 @@ def render(self, context, instance, placeholder):
'placeholder':placeholder})
return context
-plugin_pool.register_plugin(ArticlePlugin)
+plugin_pool.register_plugin(ArticlePlugin)
@@ -2,7 +2,7 @@
from cms.models import CMSPlugin
-from testapp.pluginapp.models import Section
+from cms.test.apps.pluginapp.models import Section
class ArticlePluginModel(CMSPlugin):
@@ -13,4 +13,4 @@ def __unicode__(self):
return self.title
def copy_relations(self, oldinstance):
- self.sections = oldinstance.sections.all()
+ self.sections = oldinstance.sections.all()
@@ -1,10 +1,10 @@
from django.contrib import admin
-from testapp.sampleapp.models import Picture, Category
+from cms.test.apps.sampleapp.models import Picture, Category
class PictureInline(admin.StackedInline):
model = Picture
class CategoryAdmin(admin.ModelAdmin):
inlines = [PictureInline]
-admin.site.register(Category, CategoryAdmin)
+admin.site.register(Category, CategoryAdmin)
@@ -1,11 +1,11 @@
from cms.app_base import CMSApp
-from testapp.sampleapp.menu import SampleAppMenu
+from cms.test.apps.sampleapp.menu import SampleAppMenu
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class SampleApp(CMSApp):
name = _("Sample App")
- urls = ["testapp.sampleapp.urls"]
+ urls = ["cms.test.apps.sampleapp.urls"]
menus = [SampleAppMenu]
-apphook_pool.register(SampleApp)
+apphook_pool.register(SampleApp)
@@ -4,7 +4,7 @@
from django.utils.translation import ugettext_lazy as _
from menus.base import Menu, NavigationNode
from menus.menu_pool import menu_pool
-from testapp.sampleapp.models import Category
+from cms.test.apps.sampleapp.models import Category
class SampleAppMenu(Menu):
@@ -24,4 +24,4 @@ class Meta:
class Picture(models.Model):
image = models.ImageField(upload_to="pictures")
- category = models.ForeignKey(Category)
+ category = models.ForeignKey(Category)
@@ -4,7 +4,7 @@
Also used in cms.tests.ApphooksTestCase
"""
-urlpatterns = patterns('testapp.sampleapp.views',
+urlpatterns = patterns('cms.test.apps.sampleapp.views',
url(r'^$', 'sample_view', {'message': 'sample root page',}, name='sample-root'),
url(r'^settings/$', 'sample_view', kwargs={'message': 'sample settings page'}, name='sample-settings'),
url(r'^account/$', 'sample_view', {'message': 'sample account page'}, name='sample-account'),
@@ -2,7 +2,7 @@
from django.http import Http404
from django.shortcuts import render_to_response
from django.template.context import RequestContext
-from testapp.sampleapp.models import Category
+from cms.test.apps.sampleapp.models import Category
def sample_view(request, **kw):
context = RequestContext(request, kw)
@@ -12,4 +12,4 @@ def category_view(request, id):
return render_to_response('sampleapp/category_view.html', RequestContext(request, {'category':Category.objects.get(pk=id)}))
def notfound(request):
- raise Http404
+ raise Http404
View
@@ -24,4 +24,4 @@ def _run_javascript(self, files, snippet):
with open(filename, 'r') as fobj:
lib = fobj.read()
ctx.execute(lib)
- return ctx.execute(snippet)
+ return ctx.execute(snippet)
@@ -22,4 +22,4 @@
urlpatterns = get_app_patterns() + urlpatterns
#urlpatterns = (dynamic_app_regex_url_resolver, ) + urlpatterns
-urlpatterns = patterns('', *urlpatterns)
+urlpatterns = patterns('', *urlpatterns)
@@ -10,4 +10,4 @@
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
url(r'^', include('cms.urls')),
-)
+)
@@ -11,4 +11,4 @@
url(r'^media/cms/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.CMS_MEDIA_ROOT, 'show_indexes': True}),
url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
url(r'^content/', include('cms.urls')),
-)
+)
@@ -22,4 +22,4 @@
urlpatterns = get_app_patterns() + urlpatterns
#urlpatterns = (dynamic_app_regex_url_resolver, ) + urlpatterns
-urlpatterns = patterns('', *urlpatterns)
+urlpatterns = patterns('', *urlpatterns)
@@ -12,5 +12,5 @@
{'document_root': settings.CMS_MEDIA_ROOT, 'show_indexes': True}),
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
- url(r'^', include('testapp.second_cms_urls_for_apphook_tests')),
-)
+ url(r'^', include('cms.test.project.second_cms_urls_for_apphook_tests')),
+)
@@ -71,7 +71,7 @@
)
-ROOT_URLCONF = 'testapp.urls'
+ROOT_URLCONF = 'cms.test.project.urls'
TEMPLATE_DIRS = (
@@ -99,11 +99,11 @@
'cms.plugins.twitter',
'cms.plugins.inherit',
'mptt',
- 'testapp.sampleapp',
- 'testapp.placeholderapp',
- 'testapp.pluginapp',
- 'testapp.pluginapp.plugins.manytomany_rel',
- 'testapp.fakemlng',
+ 'cms.test.project.sampleapp',
+ 'cms.test.project.placeholderapp',
+ 'cms.test.project.pluginapp',
+ 'cms.test.project.pluginapp.plugins.manytomany_rel',
+ 'cms.test.project.fakemlng',
'south',
'reversion',
)
@@ -183,12 +183,12 @@
SOUTH_TESTS_MIGRATE = False
CMS_NAVIGATION_EXTENDERS = (
- ('testapp.sampleapp.menu_extender.get_nodes', 'SampleApp Menu'),
+ ('cms.test.project.sampleapp.menu_extender.get_nodes', 'SampleApp Menu'),
)
try:
from local_settings import *
except ImportError:
pass
-TEST_RUNNER = 'testapp.testrunner.CMSTestSuiteRunner'
+TEST_RUNNER = 'cms.test.project.testrunner.CMSTestSuiteRunner'
@@ -12,4 +12,4 @@ def run_suite(self, suite, **kwargs):
if self.use_runner and not self.failfast:
return self.use_runner().run(suite)
else:
- return super(CMSTestSuiteRunner, self).run_suite(suite, **kwargs)
+ return super(CMSTestSuiteRunner, self).run_suite(suite, **kwargs)
View
@@ -13,4 +13,4 @@
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
url(r'^', include('cms.urls')),
-)
+)
@@ -12,5 +12,5 @@
{'document_root': settings.CMS_MEDIA_ROOT, 'show_indexes': True}),
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
- url(r'^', include('testapp.cms_urls_for_apphook_tests')),
-)
+ url(r'^', include('cms.test.project.cms_urls_for_apphook_tests')),
+)
@@ -135,4 +135,4 @@ def __exit__(self, exc, value, tb):
delattr(self.instance, key)
else:
setattr(self.instance, key, old_value)
- self.instance.save()
+ self.instance.save()
View
@@ -11,4 +11,4 @@ def __init__(self, **kwargs):
class DefaultAttributeObject(AttributeObject):
def __init__(self, default, **kwargs):
self.__default = default
- super(DefaultAttributeObject, self).__init__(**kwargs)
+ super(DefaultAttributeObject, self).__init__(**kwargs)
View
@@ -29,4 +29,4 @@
import traceback
exc = traceback.format_exc()
warnings.warn("JavascriptTestCase cannot be run: %s" % exc)
-
+
View
@@ -160,4 +160,4 @@ def test_06_search_fields(self):
url = reverse('admin:cms_%s_changelist' % model._meta.module_name)
response = self.client.get('%s?q=1' % url)
errmsg = response.content
- self.assertEqual(response.status_code, 200, errmsg)
+ self.assertEqual(response.status_code, 200, errmsg)
View
@@ -12,7 +12,7 @@
APP_NAME = 'SampleApp'
-APP_MODULE = "testapp.sampleapp.cms_app"
+APP_MODULE = "cms.test.apps.sampleapp.cms_app"
class ApphooksTestCase(CMSTestCase):
@@ -46,8 +46,8 @@ def test_02_implicit_apphooks(self):
if APP_MODULE in sys.modules:
del sys.modules[APP_MODULE]
- apps = ['testapp.sampleapp']
- with SettingsOverride(INSTALLED_APPS=apps, ROOT_URLCONF='testapp.urls_for_apphook_tests'):
+ apps = ['cms.test.apps.sampleapp']
+ with SettingsOverride(INSTALLED_APPS=apps, ROOT_URLCONF='cms.test.project.urls_for_apphook_tests'):
apphook_pool.clear()
hooks = apphook_pool.get_apphooks()
app_names = [hook[0] for hook in hooks]
@@ -60,7 +60,7 @@ def test_03_apphook_on_root(self):
if APP_MODULE in sys.modules:
del sys.modules[APP_MODULE]
- with SettingsOverride(ROOT_URLCONF='testapp.urls_for_apphook_tests'):
+ with SettingsOverride(ROOT_URLCONF='cms.test.project.urls_for_apphook_tests'):
apphook_pool.clear()
superuser = User.objects.create_superuser('admin', 'admin@admin.com', 'admin')
page = self.create_page(user=superuser, published=True)
@@ -85,7 +85,7 @@ def test_04_get_page_for_apphook(self):
if APP_MODULE in sys.modules:
del sys.modules[APP_MODULE]
- with SettingsOverride(ROOT_URLCONF='testapp.second_urls_for_apphook_tests'):
+ with SettingsOverride(ROOT_URLCONF='cms.test.project.second_urls_for_apphook_tests'):
apphook_pool.clear()
superuser = User.objects.create_superuser('admin', 'admin@admin.com', 'admin')
@@ -131,4 +131,4 @@ def test_04_get_page_for_apphook(self):
self.assertTemplateUsed(response, 'sampleapp/home.html')
self.assertContains(response, de_title.title)
- apphook_pool.clear()
+ apphook_pool.clear()
View
@@ -10,7 +10,7 @@
except ImportError:
from StringIO import StringIO
-ROOT_DIR = os.path.join(settings.PROJECT_DIR, '..', '..')
+ROOT_DIR = os.path.join(settings.PROJECT_DIR, '..', '..', '..')
DOCS_DIR = os.path.join(ROOT_DIR, 'docs')
View
@@ -104,4 +104,4 @@ def test_09_page_user_form_initial(self):
'can_delete_pageuser', 'can_add_pagepermission',
'can_change_pagepermission', 'can_delete_pagepermission']
for name in names:
- self.assertTrue(puf.initial.get(name, False))
+ self.assertTrue(puf.initial.get(name, False))
View
@@ -54,4 +54,4 @@ def test_02_remove_from_url(self):
]
for arg1, arg2, expected in tests:
output = self._run_javascript(files, base_snippet % (arg1, arg2))
- self.assertEqual(output, expected)
+ self.assertEqual(output, expected)
View
@@ -11,4 +11,4 @@ def setUp(self):
def test_01_mail_page_user_change(self):
user = self.create_page_user("username", grant_all=True)
mail_page_user_change(user)
- self.assertEqual(len(mail.outbox), 1)
+ self.assertEqual(len(mail.outbox), 1)
View
@@ -716,4 +716,4 @@ def test_02_top_in_nav(self):
AttributeObject(title='bbb', level=1, children=[])
])
]
- self.assertTreeQuality(soft_root, mock_tree, 'title', 'level')
+ self.assertTreeQuality(soft_root, mock_tree, 'title', 'level')
View
@@ -106,4 +106,4 @@ class Mock:
# Now the following should revert to the default language (en)
setattr(request,'COOKIES', {'django_language':'elvish'})
result = middle.get_language_from_request(request)
- self.assertEqual(result, 'en') # The default
+ self.assertEqual(result, 'en') # The default
@@ -61,4 +61,4 @@ def test_02_multilingual_page(self):
public = page.publisher_public
placeholder = public.placeholders.all()[0]
self.assertEqual(placeholder.cmsplugin_set.filter(language='de').count(), 1)
- self.assertEqual(placeholder.cmsplugin_set.filter(language='en').count(), 1)
+ self.assertEqual(placeholder.cmsplugin_set.filter(language='en').count(), 1)
View
@@ -10,7 +10,7 @@
class NonRootCase(CMSTestCase):
- urls = 'testapp.nonroot_urls'
+ urls = 'cms.test.project.nonroot_urls'
def setUp(self):
with SettingsOverride(CMS_MODERATOR = False):
View
@@ -397,7 +397,7 @@ def test_23_get_page_from_request_with_page_preview(self):
class NoAdminPageTests(CMSTestCase):
- urls = 'testapp.noadmin_urls'
+ urls = 'cms.test.project.noadmin_urls'
def setUp(self):
admin = 'django.contrib.admin'
View
@@ -10,8 +10,8 @@
from django.core.urlresolvers import reverse
from django.template import TemplateSyntaxError, Template
from django.template.context import Context, RequestContext
-from testapp.fakemlng.models import Translations
-from testapp.placeholderapp.models import Example1, Example2, Example3, Example4, \
+from cms.test.apps.fakemlng.models import Translations
+from cms.test.apps.placeholderapp.models import Example1, Example2, Example3, Example4, \
Example5
@@ -231,4 +231,4 @@ def test_04_excercise_get_attached_model(self):
def test_05_excercise_get_attached_field_name(self):
ph = Placeholder.objects.create(slot='test', default_width=300)
result = ph._get_attached_field_name()
- self.assertEqual(result, None) # Simple PH - no field name
+ self.assertEqual(result, None) # Simple PH - no field name
Oops, something went wrong.

0 comments on commit 6d69bc5

Please sign in to comment.