Esempio n. 1
0
 def test_update_delete(self):
     self.req.POST = {
         "activity_key": str(Activity.objects.all()[0].id),
         "amount": 100,
         "date": "2012-01-01",
     }
     vcs_add(self.req)
     self.req.POST = {
         "id": str(ActivityEntry.objects.all()[0].id),
         "volume": "0",
     }
     entry_id = ActivityEntry.objects.all()[0].id
     update(self.req)
     self.assertEqual(ActivityEntry.objects.filter(id=entry_id).count(), 0)
Esempio n. 2
0
 def test_update_delete(self):
     self.req.POST = {
         "activity_key": str(Activity.objects.all()[0].id),
         "amount": 100,
         "date": "2012-01-01",
     }
     vcs_add(self.req)
     self.req.POST = {
         "id": str(ActivityEntry.objects.all()[0].id),
         "volume": "0",
     }
     entry_id = ActivityEntry.objects.all()[0].id
     update(self.req)
     self.assertEqual(ActivityEntry.objects.filter(id=entry_id).count(), 0)
Esempio n. 3
0
 def test_update_entry(self):
     self.req.POST = {
         "activity_key": str(Activity.objects.all()[0].id),
         "amount": 100,
         "date": "2012-01-01",
     }
     vcs_add(self.req)
     self.req.POST = {
         "volume": 1,
         "id": str(ActivityEntry.objects.all()[0].id)
     }
     entry = ActivityEntry.objects.all()[0]
     prevol = entry.amount
     id = entry.id
     update(self.req)
     self.assertEqual(ActivityEntry.objects.get(id=id).amount, 1)
Esempio n. 4
0
 def test_update_entry(self):
     self.req.POST = {
         "activity_key": str(Activity.objects.all()[0].id),
         "amount": 100,
         "date": "2012-01-01",
     }
     vcs_add(self.req)
     self.req.POST = {
         "volume": 1,
         "id": str(ActivityEntry.objects.all()[0].id)
     }
     entry = ActivityEntry.objects.all()[0]
     prevol = entry.amount
     id = entry.id
     update(self.req)
     self.assertEqual(ActivityEntry.objects.get(id=id).amount, 1)