def test_query_properties_named_by_string_on_expando(testbed): FlexEmployee(location='SF').put() FlexEmployee(location='Amsterdam').put() query = snippets.query_properties_named_by_string_on_expando() employees = query.fetch() assert len(employees) == 1
def test_order_query_results_by_property(testbed): Article(title='2').put() Article(title='1').put() FlexEmployee(location=2).put() FlexEmployee(location=1).put() expando_query, property_query = snippets.order_query_results_by_property( 'title') assert expando_query.fetch()[0].location == 1 assert property_query.fetch()[0].title == '1'
def test_order_query_results_by_property(testbed): Article(title='2').put() Article(title='1').put() FlexEmployee(location=2).put() FlexEmployee(location=1).put() expando_query, property_query = snippets.order_query_results_by_property( 'title') if expando_query.fetch()[0].location != 1: raise AssertionError if property_query.fetch()[0].title != '1': raise AssertionError