Example #1
0
    def test_basic_app(self):
        """
        Simple case

        myapp/
          views.py
            def foo():
        """

        def foo(): pass
        foo.__module__ = 'myapp.views'

        self.assertEqual(_template_name(foo), "myapp/foo.html")
Example #2
0
    def test_module_views(self):
        """
        Views in submodules should have templates in subfolders

        myapp/
          views/
            api.py
              def foo():
        """

        def foo(): pass
        foo.__module__ = 'myapp.views.api'

        self.assertEqual(_template_name(foo), "myapp/api/foo.html")
Example #3
0
    def test_module_app(self):
        """
        Entire app is in submodule

        myproject/
          myapp/
            views.py
              def foo():
        """

        def foo(): pass
        foo.__module__ = 'myproject.myapp.views'

        self.assertEqual(_template_name(foo), "myapp/foo.html")