Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1945 (closed enhancement: wontfix)

Opened 11 years ago

Last modified 10 years ago

Move TestController to tg.testutil

Reported by: Gustavo Owned by: mramm
Priority: low Milestone: 2.0b1
Component: TurboGears Version: trunk
Severity: major Keywords:
Cc:

Description

The code needed to the controllers in a TG2 project should be moved from the default template to the tg.testutil module, in order to make the default template simpler.

Attachments

ticket-1945.patch Download (5.1 KB) - added by dlatornell 11 years ago.
Patch to move TestController? into testutil.py and change quickstart templates accordingly
ticket-1945 Download (5.1 KB) - added by dlatornell 11 years ago.

Change History

comment:1 Changed 11 years ago by Gustavo

  • Owner changed from anonymous to Gustavo
  • Status changed from new to assigned
  • Type changed from defect to enhancement

Changed 11 years ago by dlatornell

Patch to move TestController? into testutil.py and change quickstart templates accordingly

comment:2 Changed 11 years ago by dlatornell

The attached patch implements the move.

Please see  http://groups.google.ca/group/turbogears-trunk/browse_thread/thread/4f030fcba6959bc8 for discussion of issues surrounding testing of TestController and interaction with tg2/tg/tests/test_testutil.py

Changed 11 years ago by dlatornell

comment:3 Changed 11 years ago by dlatornell

Trac wasn't displaying the contents of ticket-1945.patch, so I attached it again without the .patch extension.

comment:4 Changed 11 years ago by mramm

  • Milestone changed from 1.9.7a4 to 1.9.7b1

comment:5 Changed 10 years ago by mramm

  • Owner changed from Gustavo to mramm
  • Status changed from assigned to new
  • Milestone changed from 1.9.7b1 to 2.0b1

comment:6 Changed 10 years ago by jorge.vargas

I'm not sure if this is a good idea. I got an application where every page is private so in my tests I added the following:

So now I'm -1 on this. As doing what I did below will imply I need to rewrite init and go look for what it does at the TG level.

class TestController(object):

    def __init__(self, *args, **kwargs):
        wsgiapp = loadapp('config:test.ini', relative_to=conf_dir)
        self.app = webtest.TestApp(wsgiapp)
        response = self.app.get('/login_handler?login=jorge&password=jorge')

comment:7 follow-up: ↓ 8 Changed 10 years ago by mramm

  • Priority changed from high to low

Hmm, Jorge makes a good point. This makes it lots easier to test protected web-apps. Though we could make an init that supports login in testutil too.

But barring that, I think Jorge's point is compelling enough to make this a very low priority. Any other thoughts?

comment:8 in reply to: ↑ 7 Changed 10 years ago by Gustavo

Replying to mramm:

But barring that, I think Jorge's point is compelling enough to make this a very low priority. Any other thoughts?

+1.

comment:9 Changed 10 years ago by mramm

  • Status changed from new to closed
  • Resolution set to wontfix
Note: See TracTickets for help on using tickets.