From f0b36f41c7f9cdf1524811197d575df4cf6700fc Mon Sep 17 00:00:00 2001 From: George Schneeloch Date: Wed, 21 Oct 2015 10:20:40 -0400 Subject: [PATCH] Add test for vocabularies with special names --- rest/tests/test_search.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/rest/tests/test_search.py b/rest/tests/test_search.py index 8ef0422e..73caedc7 100644 --- a/rest/tests/test_search.py +++ b/rest/tests/test_search.py @@ -674,3 +674,22 @@ def test_name_collision(self): )])['count'], 0 ) + + def test_vocabulary_with_special_name(self): + """ + Make sure that vocabularies that can collide with elasticsearch indexes + won't break anything. + """ + special_names = ( + 'run', + 'resource_type', + 'course', + 'text', + 'description_path', + ) + for name in special_names: + vocab_dict = dict(self.DEFAULT_VOCAB_DICT) + vocab_dict['name'] = name + self.create_vocabulary(self.repo.slug, vocab_dict) + # This checks for a 200 status code. + self.get_results()