Revision bbea0414 snf-cyclades-app/synnefo/helpdesk/tests.py

b/snf-cyclades-app/synnefo/helpdesk/tests.py
150 150
                                          network__public=True,
151 151
                                          network__userid=None,
152 152
                                          address="195.251.222.211")
153
        mfactory.IPAddressLogFactory(address=ip2.address,
154
                                     server_id=vm1u1.id,
155
                                     network_id=ip2.network.id,
156
                                     active=True)
153 157

  
154 158
    def test_enabled_setting(self):
155 159
        settings.HELPDESK_ENABLED = False
......
166 170
        # ip does not exist, proper message gets displayed
167 171
        r = self.client.get(reverse('helpdesk-details',
168 172
                            args=["195.251.221.122"]), user_token='0001')
169
        self.assertContains(r, 'User with IP')
173
        self.assertFalse(r.context["ip_exists"])
174
        self.assertEqual(list(r.context["ips"]), [])
170 175

  
171
        # ip exists, 'test' account discovered
176
        # ip exists
172 177
        r = self.client.get(reverse('helpdesk-details',
173 178
                            args=["195.251.222.211"]), user_token='0001')
174
        self.assertEqual(r.context['account'], USER1)
179
        self.assertTrue(r.context["ip_exists"])
180
        ips = r.context["ips"]
181
        for ip in ips:
182
            self.assertEqual(ip.address, "195.251.222.211")
175 183

  
176 184
    def test_vm_lookup(self):
177 185
        # vm id does not exist

Also available in: Unified diff