コード例 #1
0
ファイル: test_urls.py プロジェクト: airtonix/sigurd
    def test_urls_installation_empty_patterns(self):
        project_config = TestComplexProjectConfig()
        project_config.export_settings({})
        urlpatterns = project_config.install_app_urls()

        self.assertEqual(len(urlpatterns), 2)
        # prepend
        self.assertEquals(str(urlpatterns[0]), str(url(r'^profile/$', include('web.urls.profile'))))
        # append
        self.assertEquals(str(urlpatterns[len(urlpatterns)-1]), str(url(r'^$', include('web.urls'))))
コード例 #2
0
ファイル: test_urls.py プロジェクト: asolomentsev/sigurd
    def test_urls_installation_empty_patterns(self):
        project_config = TestComplexProjectConfig()
        project_config.export_settings({})
        urlpatterns = project_config.install_app_urls()

        self.assertEqual(len(urlpatterns), 2)
        # prepend
        self.assertEquals(str(urlpatterns[0]),
                          str(url(r'^profile/$', include('web.urls.profile'))))
        # append
        self.assertEquals(str(urlpatterns[len(urlpatterns) - 1]),
                          str(url(r'^$', include('web.urls'))))
コード例 #3
0
ファイル: test_urls.py プロジェクト: airtonix/sigurd
    def test_urls_installation(self):
        project_config = TestComplexProjectConfig()
        urlpatterns = patterns('',
            url(r'^$', 'demo.views.home', name='home'),
            url(r'^demo/', include('demo.foo.urls'))
        )
        project_config.export_settings({})
        urlpatterns = project_config.install_app_urls(urlpatterns)

        self.assertEqual(len(urlpatterns), 4)

        # prepend
        self.assertEquals(str(urlpatterns[0]), str(url(r'^profile/$', include('web.urls.profile'))))
        # append
        self.assertEquals(str(urlpatterns[len(urlpatterns)-1]), str(url(r'^$', include('web.urls'))))
コード例 #4
0
ファイル: test_urls.py プロジェクト: asolomentsev/sigurd
    def test_urls_installation(self):
        project_config = TestComplexProjectConfig()
        urlpatterns = patterns('', url(r'^$', 'demo.views.home', name='home'),
                               url(r'^demo/', include('demo.foo.urls')))
        project_config.export_settings({})
        urlpatterns = project_config.install_app_urls(urlpatterns)

        self.assertEqual(len(urlpatterns), 4)

        # prepend
        self.assertEquals(str(urlpatterns[0]),
                          str(url(r'^profile/$', include('web.urls.profile'))))
        # append
        self.assertEquals(str(urlpatterns[len(urlpatterns) - 1]),
                          str(url(r'^$', include('web.urls'))))