Ejemplo n.º 1
0
 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'))
Ejemplo n.º 2
0
 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'))
Ejemplo n.º 3
0
 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'))
Ejemplo n.º 4
0
 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')
Ejemplo n.º 5
0
 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'))
Ejemplo n.º 6
0
 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')
Ejemplo n.º 7
0
 def test_udf_fields_look_good(self):
     match = search._parse_predicate_key('plot.udf:The 1st Planter')
     self.assertEqual(match, 'udf:The 1st Planter')
Ejemplo n.º 8
0
 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'))
Ejemplo n.º 9
0
 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'))
Ejemplo n.º 10
0
 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'))
Ejemplo n.º 11
0
 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'))
Ejemplo n.º 12
0
 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'))
Ejemplo n.º 13
0
 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'))
Ejemplo n.º 14
0
 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'))
Ejemplo n.º 15
0
 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'))
Ejemplo n.º 16
0
 def test_key_parser_plots(self):
     # Plots go directly to a field
     match = search._parse_predicate_key('plot.width')
     self.assertEqual(match, 'width')
Ejemplo n.º 17
0
 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'))
Ejemplo n.º 18
0
 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')