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