def test_key_parser_plots(self): # Plots searches on plot go directly to a field match = search._parse_predicate_key('plot.width', mapping=search.DEFAULT_MAPPING) self.assertEqual(match, ('plot', 'width'))
def test_key_parser_trees_with_tree_map(self): # Tree searches on tree go directly to the field match = search._parse_predicate_key('tree.dbh', mapping=search.TREE_MAPPING) self.assertEqual(match, ('tree', 'dbh'))
def test_key_parser_plot_collection_udf(self): # UDF searches go on the specified model's id match = search._parse_predicate_key('udf:plot:52.action', mapping=search.TREE_MAPPING) self.assertEqual(match, ('udf:plot:52', 'plot__id'))
def test_key_parser_trees(self): # Trees require a prefix and the field match = search._parse_predicate_key('tree.dbh') self.assertEqual(match, 'tree__dbh')
def test_key_parser_trees(self): # Tree searches on plot require a prefix and the field match = search._parse_predicate_key('tree.dbh', mapping=search.DEFAULT_MAPPING) self.assertEqual(match, ('tree', 'tree__dbh'))
def test_key_parser_trees_with_tree_map(self): # Trees require a prefix and the field match = search._parse_predicate_key('tree.dbh', mapping=search.TREE_MAPPING) self.assertEqual(match, 'dbh')
def test_udf_fields_look_good(self): match = search._parse_predicate_key('plot.udf:The 1st Planter') self.assertEqual(match, 'udf:The 1st Planter')
def test_key_parser_plots_with_tree_map(self): # Plots searches on tree go require a prefix match = search._parse_predicate_key('plot.width', mapping=search.DEFAULT_MAPPING) self.assertEqual(match, ('plot', 'width'))
def test_key_parser_trees_with_tree_map(self): # Tree searches on tree go directly to the field match = search._parse_predicate_key('tree.dbh', mapping=search.DEFAULT_MAPPING) self.assertEqual(match, ('tree', 'tree__dbh'))
def test_key_parser_plot_collection_udf(self): # UDF searches go on the specified model's id match = search._parse_predicate_key('udf:plot:52.action', mapping=search.DEFAULT_MAPPING) self.assertEqual(match, ('udf:plot:52', 'id'))
def test_udf_fields_look_good(self): match = search._parse_predicate_key('plot.udf:The 1st Planter', mapping=search.DEFAULT_MAPPING) self.assertEqual(match, ('plot', 'udf:The 1st Planter'))
def test_key_parser_tree_collection_udf(self): # UDF searches go on the specified model's id match = search._parse_predicate_key('udf:tree:52.action', mapping=search.DEFAULT_MAPPING) self.assertEqual(match, ('udf:tree:52', 'tree__', 'action'))
def test_key_parser_plots_with_tree_map(self): # Plots searches on tree go require a prefix match = search._parse_predicate_key('plot.width', mapping=search.TREE_MAPPING) self.assertEqual(match, ('plot', 'plot__width'))
def test_key_parser_plots(self): # Plots go directly to a field match = search._parse_predicate_key('plot.width') self.assertEqual(match, 'width')
def test_key_parser_plots_with_tree_map(self): # Plots go directly to a field match = search._parse_predicate_key('plot.width', mapping=search.TREE_MAPPING) self.assertEqual(match, 'plot__width')