Пример #1
0
	def test_querify_2(self):
		inp = parse("\"Barack Obama\" US Pres POTUS")
		self.assertEqual(len(querify(inp, ["column1", "column2", "column3"])),4) #len should be the number of things being parsed
Пример #2
0
	def test_db_query(self):
		inp = parse("Sandy")
		quer = querify(inp,["id","name","kind"])
		self.assertEqual(str(Event.objects.filter(quer)),"[<Event: Hurricane Sandy>]")
Пример #3
0
	def test_querify_1(self):
		inp = parse("\"Barack Obama\" US President")
		assert type(querify(inp, ["column1", "column2", "column3"])) is models.query_utils.Q