Revision 2d04422f snf-cyclades-app/synnefo/api/test/flavors.py
b/snf-cyclades-app/synnefo/api/test/flavors.py | ||
---|---|---|
50 | 50 |
response = self.get('/api/v1.1/flavors') |
51 | 51 |
self.assertSuccess(response) |
52 | 52 |
|
53 |
api_flavors = json.loads(response.content)['flavors']['values']
|
|
53 |
api_flavors = json.loads(response.content)['flavors'] |
|
54 | 54 |
db_flavors = Flavor.objects.filter(deleted=False) |
55 | 55 |
self.assertEqual(len(api_flavors), len(db_flavors)) |
56 | 56 |
for api_flavor in api_flavors: |
... | ... | |
64 | 64 |
self.assertSuccess(response) |
65 | 65 |
|
66 | 66 |
db_flavors = Flavor.objects.filter(deleted=False) |
67 |
api_flavors = json.loads(response.content)['flavors']['values']
|
|
67 |
api_flavors = json.loads(response.content)['flavors'] |
|
68 | 68 |
|
69 | 69 |
self.assertEqual(len(db_flavors), len(api_flavors)) |
70 | 70 |
|
... | ... | |
108 | 108 |
"""Test that deleted flavors do not appear to flavors list""" |
109 | 109 |
response = self.get('/api/v1.1/flavors') |
110 | 110 |
self.assertSuccess(response) |
111 |
api_flavors = json.loads(response.content)['flavors']['values']
|
|
111 |
api_flavors = json.loads(response.content)['flavors'] |
|
112 | 112 |
self.assertEqual(len(api_flavors), 2) |
113 | 113 |
|
114 | 114 |
def test_deleted_flavors_details(self): |
... | ... | |
116 | 116 |
FlavorFactory(deleted=True) |
117 | 117 |
response = self.get('/api/v1.1/flavors/detail') |
118 | 118 |
self.assertSuccess(response) |
119 |
api_flavors = json.loads(response.content)['flavors']['values']
|
|
119 |
api_flavors = json.loads(response.content)['flavors'] |
|
120 | 120 |
self.assertEqual(len(api_flavors), 2) |
121 | 121 |
|
122 | 122 |
def test_wrong_flavor(self): |
Also available in: Unified diff