def test_can_use_or_logic_multi(self): """ Tests the _handle_trm_loc_logic method for multiple queries with an API that can join SearchTerms and Accounts using OR. """ specs = PipeSpecSheet.objects.get(pipe=1) # Twitter Search API engineer = Engineer(query=self.query, specs=specs) queries = engineer._handle_trm_fol_logic([self.query, self.query]) self.assertEqual(len(queries), 2)
def test_default_or_logic(self): """ Tests the _handle_trm_loc_logic method for an API that joins SearchTerms and Accounts using default OR logic. """ specs = PipeSpecSheet.objects.get(pipe=2) # Twitter Public Streams API engineer = Engineer(query=self.query, specs=specs) queries = engineer._handle_trm_fol_logic([self.query]) self.assertEqual(len(queries), 1)
def test_cannot_use_or_logic(self): """ Tests the _handle_trm_loc_logic method for an API that cannot join SearchTerms and Accounts using OR. """ specs = PipeSpecSheet.objects.get(pipe=5) # YouTube Data API engineer = Engineer(query=self.query, specs=specs) queries = engineer._handle_trm_fol_logic([self.query]) self.assertEqual(len(queries), 2)