Test coverage report: auction.forms

# auction.forms: 17 total statements, 0.0% covered

Generated: Mon 2013-04-29 18:13 CST

Source file: /home/slam/workspace/django-auction/auction/forms.py

Stats: 0 executed, 13 missed, 4 excluded, 9 ignored

1. `from django import forms`
2. `import auction.models`
3. `from auction.utils.generic import get_or_create_bidbasket`
4. `from auction.models import Lot`
5. ``
6. `class BidForm(forms.Form):`
7. `amount = forms.DecimalField()`
8. `lot_id = forms.IntegerField()`
9. ``
10. `def save_bid(self, request):`
11. `lot_id = self.data.get('lot_id')`
12. `amount = self.data.get('amount')`
13. ``
14. `lot = self.get_lot(lot_id)`
15. ``
16. `bidbasket = get_or_create_bidbasket(request)`
17. `if bidbasket:`
18. `return bidbasket.add_bid(lot, amount)`
19. `return False`
20. ``
21. `def get_lot(self, lot_id):`
22. `"""`
23. `For simplified extending.`
24. `"""`
25. `#return auction.models.Lot.objects.get(pk=lot_id)`
26. `return Lot.objects.filter(is_biddable=True).get(pk=lot_id)`