Revision 8922a5a9
b/db/tests.py | ||
---|---|---|
66 | 66 |
|
67 | 67 |
|
68 | 68 |
class FlavorTestCase(TestCase): |
69 |
def setUp(self): |
|
70 |
"""Setup the test""" |
|
71 |
# Add the Flavor object |
|
72 |
flavor = Flavor(pk=1, cpu=10, ram=10, disk=10) |
|
73 |
flavor.save() |
|
74 |
|
|
75 |
# Add the FlavorCostHistory |
|
76 |
fch = FlavorCostHistory(pk=1, cost_active=10, cost_inactive=5) |
|
77 |
fch.effective_from = date(day=01, month=01, year=2011) |
|
78 |
fch.flavor = flavor |
|
79 |
fch.save() |
|
80 |
|
|
81 |
fch = FlavorCostHistory(pk=2, cost_active=2, cost_inactive=1) |
|
82 |
fch.effective_from = date(day=01, month=01, year=2010) |
|
83 |
fch.flavor = flavor |
|
84 |
fch.save() |
|
85 |
|
|
86 |
def tearDown(self): |
|
87 |
"""Cleaning up the data""" |
|
88 |
flavor = Flavor.objects.get(pk=1) |
|
89 |
flavor.delete() |
|
69 |
fixtures = [ 'db_test_data' ] |
|
90 | 70 |
|
91 | 71 |
def test_flavor(self): |
92 | 72 |
"""Test a flavor object, its internal cost calculation and naming methods""" |
Also available in: Unified diff