Esempio 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'))
Esempio 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'))
Esempio 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'))
Esempio 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')
Esempio 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'))
Esempio 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')
Esempio 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')
Esempio 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'))
Esempio 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'))
Esempio 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'))
Esempio 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'))
Esempio 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'))
Esempio 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'))
Esempio 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'))
Esempio 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'))
Esempio 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')
Esempio 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'))
Esempio 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')