@test.create_stubs({api.neutron: ('router_list', 'network_list'),
                        api.keystone: ('tenant_list',)})
    def test_set_external_network_empty(self):
        router = self.routers.first()
        api.neutron.router_list(
            IsA(http.HttpRequest),
            search_opts=None).AndReturn([router])
        api.keystone.tenant_list(IsA(http.HttpRequest))\
            .AndReturn([self.tenants.list(), False])
        self._mock_external_network_list(alter_ids=True)
        self.mox.ReplayAll()

        res = self.client.get(self.INDEX_URL)

        table_data = res.context['table'].data
        self.assertEqual(len(table_data), 1)
        self.assertIn('(Not Found)',
                      table_data[0]['external_gateway_info']['network'])
        self.assertTemplateUsed(res, '%s/routers/index.html' % self.DASHBOARD)
        self.assertMessageCount(res, error=1)
dataset/ETHPy150Open CiscoSystems/avos/openstack_dashboard/dashboards/admin/routers/tests.py/RouterTests.test_set_external_network_empty/original