Reformat code with PyCharm
This commit is contained in:
parent
d8764dd8bc
commit
321edba5f7
7 changed files with 10 additions and 13 deletions
|
@ -15,4 +15,4 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
__version__ = '0.3.0'
|
||||
__version__ = '0.3.1'
|
||||
|
|
|
@ -19,7 +19,6 @@ from __future__ import unicode_literals
|
|||
|
||||
|
||||
class GvaRouter(object):
|
||||
|
||||
def route_for_task(self, task, args=None, kwargs=None):
|
||||
for route in ['ldap', 'file', 'mysql', 'pgsql', 'web']:
|
||||
if route in task:
|
||||
|
|
|
@ -16,10 +16,8 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
from os import environ
|
||||
# Normally you should not import ANYTHING from Django directly
|
||||
# into your settings, but ImproperlyConfigured is an exception.
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from os import environ
|
||||
|
||||
|
||||
def get_env_variable(var_name):
|
||||
|
|
|
@ -20,13 +20,13 @@ Tests for gvacommon celery router code.
|
|||
|
||||
"""
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
from gvacommon.celeryrouters import GvaRouter
|
||||
|
||||
|
||||
class GvaRouteTest(unittest.TestCase):
|
||||
|
||||
def test_route_for_task_ldap(self):
|
||||
router = GvaRouter()
|
||||
route = router.route_for_task('ldap')
|
||||
|
|
|
@ -16,16 +16,17 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
import os
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
import os
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
|
||||
from gvacommon.settings_utils import get_env_variable
|
||||
|
||||
|
||||
class GetEnvVariableTest(TestCase):
|
||||
|
||||
def test_get_existing_env_variable(self):
|
||||
os.environ['testvariable'] = 'myvalue'
|
||||
self.assertEqual(get_env_variable('testvariable'), 'myvalue')
|
||||
|
@ -37,4 +38,3 @@ class GetEnvVariableTest(TestCase):
|
|||
get_env_variable('missingvariable')
|
||||
self.assertEqual(
|
||||
str(e.exception), 'Set the missingvariable environment variable')
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ Tests for gvacommon code.
|
|||
|
||||
"""
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
try:
|
||||
|
@ -73,7 +74,6 @@ class StaffOrSelfLoginRequiredMixinTest(unittest.TestCase):
|
|||
from gvacommon.viewmixins import StaffOrSelfLoginRequiredMixin
|
||||
|
||||
class SubjectView(StaffOrSelfLoginRequiredMixin, View):
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
return "success"
|
||||
|
||||
|
|
|
@ -21,9 +21,9 @@ This module defines mixins for gnuviechadmin views.
|
|||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.http import HttpResponseForbidden
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
|
||||
|
||||
class StaffOrSelfLoginRequiredMixin(LoginRequiredMixin):
|
||||
|
|
Loading…
Reference in a new issue