Exemple #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'))
Exemple #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'))
Exemple #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'))
Exemple #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')
Exemple #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'))
Exemple #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')
Exemple #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')
Exemple #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'))
Exemple #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'))
Exemple #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'))
Exemple #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'))
Exemple #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'))
Exemple #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'))
Exemple #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'))
Exemple #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'))
Exemple #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')
Exemple #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'))
Exemple #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')