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

b/snf-astakos-app/astakos/im/tests/projects.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
......
49 50
    def setUp(self):
50 51
        self.client = Client()
51 52
        component1 = Component.objects.create(name="comp1")
52
        register.add_service(component1, "service1", "type1", [])
53
        register.add_service(component1, "σέρβις1", "type1", [])
53 54
        # custom service resources
54
        resource11 = {"name": "service1.resource11",
55
                      "desc": "resource11 desc",
55
        resource11 = {"name": u"σέρβις1.ρίσορς11",
56
                      "desc": u"ρίσορς11 desc",
56 57
                      "service_type": "type1",
57
                      "service_origin": "service1",
58
                      "service_origin": u"σέρβις1",
58 59
                      "ui_visible": True}
59 60
        r, _ = register.add_resource(resource11)
60 61
        register.update_base_default(r, 100)
61
        resource12 = {"name": "service1.resource12",
62
                      "desc": "resource11 desc",
62
        resource12 = {"name": u"σέρβις1.resource12",
63
                      "desc": "resource12 desc",
63 64
                      "service_type": "type1",
64
                      "service_origin": "service1",
65
                      "service_origin": u"σέρβις1",
65 66
                      "unit": "bytes"}
66 67
        r, _ = register.add_resource(resource12)
67 68
        register.update_base_default(r, 1024)
......
162 163
        self.assertEqual(status, 409)
163 164

  
164 165
        app1 = {"name": "test.pr",
166
                "description": u"δεσκρίπτιον",
165 167
                "end_date": "2013-5-5T20:20:20Z",
166 168
                "join_policy": "auto",
167 169
                "max_members": 5,
168
                "resources": {"service1.resource11": {
170
                "resources": {u"σέρβις1.ρίσορς11": {
169 171
                    "project_capacity": 1024,
170 172
                    "member_capacity": 512}}
171 173
                }
......
190 192
        self.assertEqual(body["last_application"]["state"], "pending")
191 193
        self.assertEqual(body["state"], "uninitialized")
192 194
        self.assertEqual(body["owner"], self.user1.uuid)
195
        self.assertEqual(body["description"], u"δεσκρίπτιον")
193 196

  
194 197
        # Approve forbidden
195 198
        status = self.project_action(project_id, "approve", app_id=app_id,
......
233 236
                "join_policy": "moderated",
234 237
                "leave_policy": "auto",
235 238
                "max_members": 3,
236
                "resources": {"service1.resource11": {
239
                "resources": {u"σέρβις1.ρίσορς11": {
237 240
                    "project_capacity": 1024,
238 241
                    "member_capacity": 1024}}
239 242
                }
......
597 600
        status, body = self.create(ap, h_owner)
598 601
        self.assertEqual(status, 400)
599 602

  
600
        ap["resources"] = {"service1.resource11": {
603
        ap["resources"] = {u"σέρβις1.ρίσορς11": {
601 604
                "member_capacity": 512}}
602 605
        status, body = self.create(ap, h_owner)
603 606
        self.assertEqual(status, 400)
604 607

  
605
        ap["resources"] = {"service1.resource11": {"member_capacity": 512,
606
                                                   "project_capacity": 1024}}
608
        ap["resources"] = {u"σέρβις1.ρίσορς11": {"member_capacity": 512,
609
                                                 "project_capacity": 1024}}
607 610
        status, body = self.create(ap, h_owner)
608 611
        self.assertEqual(status, 201)
609 612

  

Also available in: Unified diff