Commit 4226868b by Oleg Marshev

Overwrite default annotator-store settings.

parent 97bc56cf
from notesserver import client
client.set_es_settings()
......@@ -2,6 +2,8 @@ import unittest
from mock import patch
from django.core.urlresolvers import reverse
from django.conf import settings
from rest_framework import status
from rest_framework.test import APITestCase
......@@ -15,6 +17,9 @@ class AnnotationViewTests(APITestCase):
Tests for annotation views.
"""
def setUp(self):
assert Annotation.es.host == settings.ELASTICSEARCH_URL
assert Annotation.es.index == settings.ELASTICSEARCH_INDEX
annotation.Annotation.create_all()
es.conn.cluster.health(wait_for_status='yellow')
......
......@@ -2,5 +2,9 @@ from django.conf import settings
from annotator import es
es.host = getattr(settings, 'ELASTICSEARCH_URL', 'http://localhost:9200')
es.index = getattr(settings, 'ELASTICSEARCH_INDEX', 'edx-notes')
def set_es_settings():
"""
Overwrite default annotator-store elasticsearch settings.
"""
es.host = getattr(settings, 'ELASTICSEARCH_URL', 'http://localhost:9200')
es.index = getattr(settings, 'ELASTICSEARCH_INDEX', 'edx-notes-dev')
......@@ -21,6 +21,8 @@ INSTALLED_APPS = (
'rest_framework',
'rest_framework_swagger',
'corsheaders',
'notesapi',
'notesapi.v1',
)
STATIC_URL = '/static/'
......
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