def test_case_insensitive(self): """Suggestion does not care about case of the prefix.""" # Generate demo tag into the system tags = [make_tag() for i in range(5)] [DBSession.add(t) for t in tags] test_str = tags[0].name[0:4].upper() suggestions = TagMgr.complete(test_str) ok_(tags[0] in suggestions, "The sample tag was found in the completion set")
def test_basic_complete(self): """Tags should provide completion options.""" # Generate demo tag into the system tags = [make_tag() for i in range(5)] [DBSession.add(t) for t in tags] test_str = tags[0].name[0:2] suggestions = TagMgr.complete(test_str) ok_(tags[0] in suggestions, "The sample tag was found in the completion set")