Revision 14402edc snf-cyclades-app/synnefo/api/tests/servers.py

b/snf-cyclades-app/synnefo/api/tests/servers.py
544 544
        self.assertEqual(len(vm.nics.all()), 3)
545 545

  
546 546
    def test_create_server_with_port(self, mrapi):
547
        # Test invalid networks
548
        request = deepcopy(self.request)
549
        request["server"]["networks"] = {"foo": "lala"}
550
        with override_settings(settings, **self.network_settings):
551
            response = self.mypost("servers", "dummy_user",
552
                                   json.dumps(request), 'json')
553
        self.assertBadRequest(response)
554
        request["server"]["networks"] = ['1', '2']
555
        with override_settings(settings, **self.network_settings):
556
            response = self.mypost("servers", "dummy_user",
557
                                   json.dumps(request), 'json')
558
        self.assertBadRequest(response)
547 559
        mrapi().CreateInstance.return_value = 42
548 560
        ip = mfactory.IPv4AddressFactory(nic__machine=None)
549 561
        port1 = ip.nic

Also available in: Unified diff