diff --git a/openslides/__init__.py b/openslides/__init__.py
index dcf78b46d..add5f4fcb 100644
--- a/openslides/__init__.py
+++ b/openslides/__init__.py
@@ -11,8 +11,8 @@ RELEASE = False
def get_version(version=None, release=None):
"""
- Derives a PEP386-compliant version number from VERSION. Adds id of
- the current git commit.
+ Derives a PEP386-compliant version number from VERSION. Adds '-dev',
+ if it is not a release commit.
"""
if version is None:
version = VERSION
diff --git a/tests/config/test_config.py b/tests/config/test_config.py
index ccdade5ca..13dfceaca 100644
--- a/tests/config/test_config.py
+++ b/tests/config/test_config.py
@@ -56,6 +56,14 @@ class HandleConfigTest(TestCase):
config['string_var'] = 'other_special_unique_string dauTex9eAiy7jeen'
self.assertEqual(config['string_var'], 'other_special_unique_string dauTex9eAiy7jeen')
+ def test_missing_cache_(self):
+ del config._cache
+ self.assertEqual(config['string_var'], 'default_string_rien4ooCZieng6ah')
+
+ def test_config_contains(self):
+ self.assertTrue('string_var' in config)
+ self.assertFalse('unknown_config_var' in config)
+
class ConfigFormTest(TestCase):
@@ -155,6 +163,16 @@ class ConfigFormTest(TestCase):
response = self.client_manager.get('/config/testgroupedpage1/')
self.assertNotContains(response=response, text='Ho5iengaoon5Hoht', status_code=200)
+ def test_extra_stylefiles(self):
+ response = self.client_manager.get('/config/testgroupedpage1/')
+ text = ''
+ self.assertContains(response=response, text=text, status_code=200)
+
+ def test_extra_javascript(self):
+ response = self.client_manager.get('/config/testgroupedpage1/')
+ text = ''
+ self.assertContains(response=response, text=text, status_code=200)
+
class ConfigWeightTest(TestCase):
@@ -222,7 +240,9 @@ def set_grouped_config_page(sender, **kwargs):
url='testgroupedpage1',
required_permission='config.can_manage',
weight=10000,
- groups=(group_1, group_2))
+ groups=(group_1, group_2),
+ extra_context={'extra_stylefiles': ['styles/test-config-sjNN56dFGDrg2.css'],
+ 'extra_javascript': ['javascript/test-config-djg4dFGVslk4209f.js']})
@receiver(config_signal, dispatch_uid='set_simple_config_page_for_testing')
diff --git a/tests/core/__init__.py b/tests/core/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/tests/core/test_views.py b/tests/core/test_views.py
new file mode 100644
index 000000000..d8eb18152
--- /dev/null
+++ b/tests/core/test_views.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+ Tests for openslides.core.views
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ :copyright: 2011–2013 by OpenSlides team, see AUTHORS.
+ :license: GNU GPL, see LICENSE for more details.
+"""
+
+from django.test.client import Client
+
+from openslides.utils.test import TestCase
+from openslides import get_version
+from openslides.participant.models import User
+
+
+class VersionViewTest(TestCase):
+ def test_get(self):
+ user = User.objects.create_user('CoreMaximilian', 'xxx@xx.xx', 'default')
+ client = Client()
+ client.login(username='CoreMaximilian', password='default')
+ response = client.get('/version/')
+ self.assertContains(response, get_version(), status_code=200)
diff --git a/tests/person_api/__init__.py b/tests/person_api/__init__.py
index e69de29bb..87a40177c 100644
--- a/tests/person_api/__init__.py
+++ b/tests/person_api/__init__.py
@@ -0,0 +1,13 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+"""
+ openslides.person_api
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ Unit test for the person api.
+
+ :copyright: 2011–2013 by OpenSlides team, see AUTHORS.
+ :license: GNU GPL, see LICENSE for more details.
+"""
+
+VERSION = (9999, 9999, 9999, 'alpha', 1)