Ejemplo n.º 1
0
 def test_empty_trash2(self):
     a1 = Apple.objects.create(color="red")
     Apple.objects.create(color="green")
     self.assertEqual(Apple.objects.count(), 2)
     self.assertEqual(Apple.trash.count(), 0)
     Apple.empty_trash()
     self.assertEqual(Apple.objects.count(), 2)
     self.assertEqual(Apple.trash.count(), 0)
     a1.delete()
     self.assertEqual(Apple.objects.count(), 2)
     self.assertEqual(Apple.trash.count(), 1)
     Apple.empty_trash()
     self.assertEqual(Apple.objects.count(), 1)
     self.assertEqual(Apple.trash.count(), 0)
     self.assertEqual(Apple.objects.all()[0].color, "green")
Ejemplo n.º 2
0
 def test_empty_trash2(self):
     a1 = Apple.objects.create(color="red")
     Apple.objects.create(color="green")
     self.assertEqual(Apple.objects.count(), 2)
     self.assertEqual(Apple.trash.count(), 0)
     Apple.empty_trash()
     self.assertEqual(Apple.objects.count(), 2)
     self.assertEqual(Apple.trash.count(), 0)
     a1.delete()
     self.assertEqual(Apple.objects.count(), 2)
     self.assertEqual(Apple.trash.count(), 1)
     Apple.empty_trash()
     self.assertEqual(Apple.objects.count(), 1)
     self.assertEqual(Apple.trash.count(), 0)
     self.assertEqual(Apple.objects.all()[0].color, "green")
Ejemplo n.º 3
0
 def test_empty_trash(self):
     Apple.empty_trash()
     self.assertEqual(Apple.objects.count(), 0)
     self.assertEqual(Apple.trash.count(), 0)
     a1 = Apple.objects.create(color="red")
     self.assertEqual(Apple.objects.count(), 1)
     self.assertEqual(Apple.trash.count(), 0)
     a1.empty_trash()
     self.assertEqual(Apple.objects.count(), 1)
     self.assertEqual(Apple.trash.count(), 0)
     a1.delete()
     self.assertEqual(Apple.objects.count(), 1)
     self.assertEqual(Apple.trash.count(), 1)
     a1.empty_trash()
     self.assertEqual(Apple.objects.count(), 0)
     self.assertEqual(Apple.trash.count(), 0)
Ejemplo n.º 4
0
 def test_empty_trash(self):
     Apple.empty_trash()
     self.assertEqual(Apple.objects.count(), 0)
     self.assertEqual(Apple.trash.count(), 0)
     a1 = Apple.objects.create(color="red")
     self.assertEqual(Apple.objects.count(), 1)
     self.assertEqual(Apple.trash.count(), 0)
     a1.empty_trash()
     self.assertEqual(Apple.objects.count(), 1)
     self.assertEqual(Apple.trash.count(), 0)
     a1.delete()
     self.assertEqual(Apple.objects.count(), 1)
     self.assertEqual(Apple.trash.count(), 1)
     a1.empty_trash()
     self.assertEqual(Apple.objects.count(), 0)
     self.assertEqual(Apple.trash.count(), 0)