Commit 13f4a11f authored by Patrick Kimber's avatar Patrick Kimber

ci tests on postgres

parent af5807ad
Pipeline #8871693 failed with stage
in 58 seconds
......@@ -27,7 +27,7 @@ class TestEvent(TestCase):
BookingFactory(title='b', permission=user)
BookingFactory(title='c', permission=staff)
BookingFactory(title='d')
events = Booking.objects._public_calendar()
events = Booking.objects._public_calendar().order_by('title')
self.assertEquals(
['a', 'd'],
[e.title for e in events]
......
# -*- encoding: utf-8 -*-
""" Django settings """
import os
# 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.core.urlresolvers import reverse_lazy
def get_env_variable(key):
"""
Get the environment variable or return exception
Copied from Django two scoops book
"""
try:
return os.environ[key]
except KeyError:
error_msg = "Set the {} env variable".format(key)
print('ImproperlyConfigured: {}'.format(error_msg))
raise ImproperlyConfigured(error_msg)
DEBUG = True
TESTING = False
THUMBNAIL_DEBUG = DEBUG
......
# -*- encoding: utf-8 -*-
from .base import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'temp.db',
'USER': '',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'dev_test_record',
'USER': get_env_variable('DATABASE_USER'),
'PASSWORD': '',
'HOST': '',
'HOST': get_env_variable('DATABASE_HOST'),
'PORT': '',
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment