コード例 #1
0
ファイル: tests.py プロジェクト: haleyyew/CPSC310_project
    def test_flush_garden_and_trees_with_one_garden(self):
        g = create_garden()

        self.assertEqual(Garden.objects.all().count(), 1)
        self.assertEqual(FoodTree.objects.all().count(), 0)

        ajax_import.flush_gardens_and_trees()

        self.assertEqual(Garden.objects.all().count(), 0)
        self.assertEqual(FoodTree.objects.all().count(), 0)
コード例 #2
0
    def test_flush_garden_and_trees_with_one_garden(self):
        g = create_garden()

        self.assertEqual(Garden.objects.all().count(), 1)
        self.assertEqual(FoodTree.objects.all().count(), 0)

        ajax_import.flush_gardens_and_trees()

        self.assertEqual(Garden.objects.all().count(), 0)
        self.assertEqual(FoodTree.objects.all().count(), 0)
コード例 #3
0
ファイル: tests.py プロジェクト: haleyyew/CPSC310_project
    def test_flush_garden_and_trees_with_many_gardens_and_trees(self):
        create_garden()

        g = create_garden()
        create_food_tree(g)

        g = create_garden()
        create_food_tree(g)
        create_food_tree(g)
        create_food_tree(g)

        self.assertEqual(Garden.objects.all().count(), 3)
        self.assertEqual(FoodTree.objects.all().count(), 4)

        ajax_import.flush_gardens_and_trees()

        self.assertEqual(Garden.objects.all().count(), 0)
        self.assertEqual(FoodTree.objects.all().count(), 0)
コード例 #4
0
    def test_flush_garden_and_trees_with_many_gardens_and_trees(self):
        create_garden()

        g = create_garden()
        create_food_tree(g)

        g = create_garden()
        create_food_tree(g)
        create_food_tree(g)
        create_food_tree(g)

        self.assertEqual(Garden.objects.all().count(), 3)
        self.assertEqual(FoodTree.objects.all().count(), 4)

        ajax_import.flush_gardens_and_trees()

        self.assertEqual(Garden.objects.all().count(), 0)
        self.assertEqual(FoodTree.objects.all().count(), 0)