From 3c5d02776a1e80352c62008d1e500849b75aab0b Mon Sep 17 00:00:00 2001
From: Jan Dittberner <jan@dittberner.info>
Date: Mon, 1 Feb 2016 22:27:05 +0000
Subject: [PATCH] Update Django and gvacommon dependencies

This commit updates the Django dependency version to 1.9.2 and gvacommon
to 0.3.0 that provides gvacommon.settings_utils.get_env_variable. The
gnuviechadmin.settings.base module now uses this implementation instead
of an own copy and the corresponding test has been removed too.
---
 gnuviechadmin/gnuviechadmin/settings/base.py  | 20 +---------------
 .../gnuviechadmin/tests/test_settings.py      | 23 -------------------
 requirements/base.txt                         |  4 ++--
 3 files changed, 3 insertions(+), 44 deletions(-)
 delete mode 100644 gnuviechadmin/gnuviechadmin/tests/test_settings.py

diff --git a/gnuviechadmin/gnuviechadmin/settings/base.py b/gnuviechadmin/gnuviechadmin/settings/base.py
index 15b4128..d1ce425 100644
--- a/gnuviechadmin/gnuviechadmin/settings/base.py
+++ b/gnuviechadmin/gnuviechadmin/settings/base.py
@@ -5,30 +5,12 @@ Common settings and globals.
 
 """
 
-from os import environ
 from os.path import abspath, basename, dirname, join, normpath
 from sys import path
 
-# Normally you should not import ANYTHING from Django directly
-# into your settings, but ImproperlyConfigured is an exception.
-from django.core.exceptions import ImproperlyConfigured
 from django.contrib.messages import constants as messages
 
-
-def get_env_variable(var_name):
-    """
-    Get a setting from an environment variable.
-
-    :param str var_name: variable name
-    :raises ImproperlyConfigured: if the environment setting is not defined
-    :return: environment setting value
-    :rtype: str
-    """
-    try:
-        return environ[var_name]
-    except KeyError:
-        error_msg = "Set the %s environment variable" % var_name
-        raise ImproperlyConfigured(error_msg)
+from gvacommon.settings_utils import get_env_variable
 
 
 # ######### PATH CONFIGURATION
diff --git a/gnuviechadmin/gnuviechadmin/tests/test_settings.py b/gnuviechadmin/gnuviechadmin/tests/test_settings.py
deleted file mode 100644
index ed69779..0000000
--- a/gnuviechadmin/gnuviechadmin/tests/test_settings.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# -*- python -*-
-# -*- coding: utf-8 -*-
-import os
-from unittest import TestCase
-
-from django.core.exceptions import ImproperlyConfigured
-
-from gnuviechadmin.settings.base 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')
-
-    def test_get_missing_env_variable(self):
-        if 'missingvariable' in os.environ:
-            del os.environ['missingvariable']
-        with self.assertRaises(ImproperlyConfigured) as e:
-            get_env_variable('missingvariable')
-        self.assertEqual(
-            str(e.exception), 'Set the missingvariable environment variable')
diff --git a/requirements/base.txt b/requirements/base.txt
index d08a5dc..ab8fc2c 100644
--- a/requirements/base.txt
+++ b/requirements/base.txt
@@ -1,4 +1,4 @@
-Django==1.9.1
+Django==1.9.2
 curtsies==0.1.21
 bpython==0.14.2
 django-braces==1.8.1
@@ -18,5 +18,5 @@ python-openid==2.2.5
 requests==2.9.1
 requests-oauthlib==0.6.0
 simplejson==3.8.1
--e git+https://git.gnuviech-server.de/gvacommon.git@0.2.1#egg=gvacommon
+-e git+https://git.gnuviech-server.de/gvacommon.git@0.3.0#egg=gvacommon
 redis==2.10.5