Beispiel #1
0
    def test_global_registries(self):
        from pyramid.config import global_registries

        config1 = self._makeConfigurator()
        config1.make_wsgi_app()
        self.assertEqual(global_registries.last, config1.registry)
        config2 = self._makeConfigurator()
        config2.make_wsgi_app()
        self.assertEqual(global_registries.last, config2.registry)
        self.assertEqual(list(global_registries),
                         [config1.registry, config2.registry])
        global_registries.remove(config2.registry)
        self.assertEqual(global_registries.last, config1.registry)
Beispiel #2
0
    def test_global_registries(self):
        from pyramid.config import global_registries

        config1 = self._makeConfigurator()
        config1.make_wsgi_app()
        self.assertEqual(global_registries.last, config1.registry)
        config2 = self._makeConfigurator()
        config2.make_wsgi_app()
        self.assertEqual(global_registries.last, config2.registry)
        self.assertEqual(
            list(global_registries), [config1.registry, config2.registry]
        )
        global_registries.remove(config2.registry)
        self.assertEqual(global_registries.last, config1.registry)