def test_count_function_that_behaves_the_exact_same_way_as_filter_but_returns_only_count_of_results( self): expr = 'Diana' file = 'example_data.csv' expected_result = 2 self.assertEqual(queries.count(file, full_name_startswith=expr), expected_result)
def test_count_by_salary_gt_1000_and_lt_3000_order_by_salary(self): my_file = "test_data.csv" expected = 3 self.assertEqual( count(my_file, salary__gt=1000, salary__lt=3000, order_by='salary'), expected)
def test_count_by_email_that_contains(self): my_file = "test_data.csv" expected = 1 self.assertEqual(count(my_file, email__contains="@gmail"), expected)
def test_count_by_first_name_that_startswith(self): my_file = "test_data.csv" expected = 1 self.assertEqual(count(my_file, full_name__startswith="Diana Harris"), expected)
def test_count_by_first_name_and_favourite_color(self): my_file = "test_data.csv" expected = 1 self.assertEqual( count(my_file, full_name="Diana Harris", favourite_color="lime"), expected)