Revision ba777b02 snf-cyclades-app/synnefo/api/tests/networks.py

b/snf-cyclades-app/synnefo/api/tests/networks.py
37 37
from synnefo.lib.services import get_service_path
38 38
from synnefo.lib import join_urls
39 39
import synnefo.db.models_factory as dbmf
40
from synnefo.db.models import Network
40
from synnefo.db.models import Network, QuotaHolderSerial
41 41
from django.conf import settings
42 42

  
43 43
NETWORK_URL = get_service_path(cyclades_services, 'network',
......
92 92
        self.assertEqual(commission_resources, {"cyclades.network.private": 1})
93 93
        name, args, kwargs =\
94 94
            self.mocked_quotaholder.resolve_commissions.mock_calls[0]
95
        serial = Network.objects.get().serial.serial
95
        serial = QuotaHolderSerial.objects.order_by("-serial")[0]
96 96
        accepted_serials = args[0]
97 97
        rejected_serials = args[1]
98
        self.assertEqual(accepted_serials, [serial])
98
        self.assertEqual(accepted_serials, [serial.serial])
99 99
        self.assertEqual(rejected_serials, [])
100 100

  
101 101
        # test no name

Also available in: Unified diff