示例#1
0
    def test_save(self):
        """
        Saving the form should update the last tier changed date and actually
        change the tier.

        """
        token = make_tier_change_token(self.tier1)
        form = TierChangeForm({'tier': self.tier1.slug, 'token': token})
        self.assertTrue(form.is_valid())
        self.assertEqual(self.tier_info.tier, self.tier2)
        old_tier_changed = self.tier_info.tier_changed
        form.save()
        self.assertEqual(self.tier_info.tier, self.tier1)
        self.assertGreater(self.tier_info.tier_changed, old_tier_changed)
    def test_save(self):
        """
        Saving the form should update the last tier changed date and actually
        change the tier.

        """
        token = make_tier_change_token(self.tier1)
        form = TierChangeForm({'tier': self.tier1.slug, 'token': token})
        self.assertTrue(form.is_valid())
        self.assertEqual(self.tier_info.tier, self.tier2)
        old_tier_changed = self.tier_info.tier_changed
        form.save()
        self.assertEqual(self.tier_info.tier, self.tier1)
        self.assertGreater(self.tier_info.tier_changed, old_tier_changed)
示例#3
0
 def handle_form(self, data):
     form = TierChangeForm(data)
     if form.is_valid():
         form.save()
示例#4
0
 def handle_form(self, data):
     form = TierChangeForm(data)
     if form.is_valid():
         form.save()