def test_no_synonyms(self): """Test that when there are no synonyms an alternate filter is made.""" _, body = es_utils.es_get_synonym_filter('en-US') eq_(body, { 'type': 'synonym', 'synonyms': ['firefox => firefox'], })
def test_no_synonyms(self): """Test that when there are no synonyms an alternate filter is made.""" _, body = es_utils.es_get_synonym_filter("en-US") eq_(body, { "type": "synonym", "synonyms": ["firefox => firefox"], })
def test_no_synonyms(self): """Test that when there are no synonyms an alternate filter is made.""" _, body = es_utils.es_get_synonym_filter('en-US') eq_(body, { 'type': 'synonym', 'synonyms': ['firefox => firefox'], })
def test_with_some_synonyms(self): SynonymFactory(from_words="foo", to_words="bar") SynonymFactory(from_words="baz", to_words="qux") _, body = es_utils.es_get_synonym_filter("en-US") expected = { "type": "synonym", "synonyms": ["foo => bar", "baz => qux",], } eq_(body, expected)
def test_with_some_synonyms(self): synonym(from_words='foo', to_words='bar', save=True) synonym(from_words='baz', to_words='qux', save=True) _, body = es_utils.es_get_synonym_filter('en-US') expected = { 'type': 'synonym', 'synonyms': [ 'foo => bar', 'baz => qux', ], } eq_(body, expected)
def test_with_some_synonyms(self): SynonymFactory(from_words='foo', to_words='bar') SynonymFactory(from_words='baz', to_words='qux') _, body = es_utils.es_get_synonym_filter('en-US') expected = { 'type': 'synonym', 'synonyms': [ 'foo => bar', 'baz => qux', ], } eq_(body, expected)
def test_name(self): """Test that the right name is returned.""" name, _ = es_utils.es_get_synonym_filter("en-US") eq_(name, "synonyms-en-US")
def test_name(self): """Test that the right name is returned.""" name, _ = es_utils.es_get_synonym_filter('en-US') eq_(name, 'synonyms-en-US')