Revision 62a4a5ae snf-astakos-app/astakos/im/tests/api.py

b/snf-astakos-app/astakos/im/tests/api.py
1
# -*- coding: utf-8 -*-
1 2
# Copyright 2011, 2012, 2013 GRNET S.A. All rights reserved.
2 3
#
3 4
# Redistribution and use in source and binary forms, with or
......
60 61
        component1 = Component.objects.create(name="comp1")
61 62
        register.add_service(component1, "service1", "type1", [])
62 63
        # custom service resources
63
        resource11 = {"name": "service1.resource11",
64
                      "desc": "resource11 desc",
64
        resource11 = {"name": u"service1.ρίσορς11",
65
                      "desc": "ρίσορς11 desc",
65 66
                      "service_type": "type1",
66 67
                      "service_origin": "service1",
67 68
                      "ui_visible": True}
68 69
        r, _ = register.add_resource(resource11)
69 70
        register.update_base_default(r, 100)
70 71
        resource12 = {"name": "service1.resource12",
71
                      "desc": "resource11 desc",
72
                      "desc": "ρίσορς11 desc",
72 73
                      "service_type": "type1",
73 74
                      "service_origin": "service1",
74 75
                      "unit": "bytes"}
......
88 89
        register.add_service(component2, "service2", "type2", [])
89 90
        # create another service
90 91
        resource21 = {"name": "service2.resource21",
91
                      "desc": "resource11 desc",
92
                      "desc": "ρίσορς11 desc",
92 93
                      "service_type": "type2",
93 94
                      "service_origin": "service2",
94 95
                      "ui_visible": False}
......
169 170
        commission_request = {
170 171
            "force": False,
171 172
            "auto_accept": False,
172
            "name": "my commission",
173
            "name": u"ναμε",
173 174
            "provisions": [
174 175
                {
175 176
                    "holder": "user:" + user.uuid,
......
218 219
        body = json.loads(r.content)
219 220
        self.assertEqual(body['serial'], serial1)
220 221
        assertIn('issue_time', body)
222
        self.assertEqual(body["name"], u"ναμε")
221 223
        provisions = sorted(body['provisions'], key=lambda p: p['resource'])
222
        self.assertEqual(provisions, commission_request['provisions'])
224
        crp = sorted(commission_request['provisions'], key=lambda p: p['resource'])
225
        self.assertEqual(provisions, crp)
223 226
        self.assertEqual(body['name'], commission_request['name'])
224 227

  
225 228
        r = client.get(u('service_quotas?user=' + user.uuid), **s1_headers)
......
303 306

  
304 307
        commission_request = {
305 308
            "auto_accept": True,
306
            "name": "my commission",
309
            "name": "κομίσσιον",
307 310
            "provisions": "dummy"}
308 311

  
309 312
        post_data = json.dumps(commission_request)

Also available in: Unified diff