Ejemplo n.º 1
0
 def test_or_specs_or_query(self):
     """
     Tests the _separate_components method for a query that joins SearchTerms
     and Locations with OR logic, with an API that joins SearchTerms and
     Accounts using OR logic.
     """
     self.query.trm_loc_logic = 'OR'
     specs = PipeSpecSheet.objects.get(pipe=2)  # Twitter Public Streams API
     engineer = Engineer(query=self.query, specs=specs)
     queries = engineer._separate_components()
     self.assertEqual(len(queries), 1)
Ejemplo n.º 2
0
 def test_and_specs_and_query(self):
     """
     Tests the _separate_components method for a query that joins SearchTerms
     and Locations with AND logic, with an API that can't join SearchTerms
     and Accounts using OR logic.
     """
     self.query.trm_loc_logic = 'AND'
     specs = PipeSpecSheet.objects.get(pipe=5)  # YouTube Data API
     engineer = Engineer(query=self.query, specs=specs)
     queries = engineer._separate_components()
     self.assertEqual(len(queries), 2)