Changeset 5707

Show
Ignore:
Timestamp:
11/18/08 04:08:27 (2 months ago)
Author:
jorge.vargas
Message:

- moving base quickstart project tests to nose
- fixed several typos in the templates

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • projects/tg.devtools/trunk/devtools/templates/turbogears/+package+/config/middleware.py_tmpl

    r5130 r5707  
    33from {{package}}.config.environment import load_environment 
    44 
    5 #Use base_config to setup the nessisary WSGI App factory.  
     5#Use base_config to setup the necessary WSGI App factory.  
    66#make_base_app will wrap the TG2 app with all the middleware it needs.  
    77make_base_app = base_config.setup_tg_wsgi_app(load_environment) 
  • projects/tg.devtools/trunk/devtools/templates/turbogears/+package+/tests/functional/test_root.py_tmpl

    r5091 r5707  
    22 
    33from {{package}}.tests import TestController 
     4from nose.tools import assert_true 
    45 
    56# This is an example of how you can write functional tests for your controller. 
     
    1415              'designed to make your life easier.' 
    1516        # You can look for specific strings: 
    16         self.failUnless(msg in response) 
    17         # You cam also access a BeautifulSoup'ed version 
     17        assert_true(msg in response) 
     18        # You can also access a BeautifulSoup'ed version 
     19        # first run $ easy_install BeautifulSoup and then run this test  
    1820        links = response.html.findAll('a') 
    19         self.failUnless(links, "Mummy, there are no links here!") 
     21        assert_true(links, "Mummy, there are no links here!") 
  • projects/tg.devtools/trunk/devtools/templates/turbogears/+package+/tests/__init__.py_tmpl

    r5091 r5707  
    1111import os 
    1212import sys 
    13 from unittest import TestCase 
    1413 
    1514import pkg_resources 
     
    3332cmd.run([test_file]) 
    3433 
    35 class TestController(TestCase): 
     34class TestController(object): 
    3635 
    3736    def __init__(self, *args, **kwargs): 
    3837        wsgiapp = loadapp('config:test.ini', relative_to=conf_dir) 
    3938        self.app = webtest.TestApp(wsgiapp) 
    40         TestCase.__init__(self, *args, **kwargs) 
  • projects/tg.devtools/trunk/devtools/templates/turbogears/+package+/tests/test_models.py_tmpl

    r5599 r5707  
    33 
    44from tg.testutil import DBTest 
     5from nose.tools import eq_ 
    56 
    67from {{package}} import model 
     
    2425    def test_member_creation_username(self): 
    2526        """The member constructor must set the user name right""" 
    26         self.assertEqual(self.member.user_name, u"ignucius") 
     27        eq_(self.member.user_name, u"ignucius") 
    2728         
    2829    def test_member_creation_email(self): 
    2930        """The member constructor must set the email right""" 
    30         self.assertEqual(self.member.email_address, u"ignucius@example.org") 
     31        eq_(self.member.email_address, u"ignucius@example.org") 
    3132     
    3233    def test_no_permissions_by_default(self): 
    3334        """User objects should have no permission by default.""" 
    34         self.assertEqual(len(self.member.permissions), 0) 
     35        eq_(len(self.member.permissions), 0) 
    3536         
    3637    def test_getting_by_email(self): 
     
    3839        model.DBSession.add(self.member) 
    3940        him = model.User.by_email_address(u"ignucius@example.org") 
    40         self.assertEqual(him, self.member) 
     41        eq_(him, self.member) 
    4142 
    4243{{endif}} 
  • projects/tg.devtools/trunk/devtools/templates/turbogears/+package+/websetup.py_tmpl

    r5633 r5707  
    4343 
    4444    model.DBSession.save(p) 
    45     model.DBSession.flush() 
    4645 
    4746    u1 = model.User() 
  • projects/tg.devtools/trunk/devtools/templates/turbogears/setup.py_tmpl

    r5351 r5707  
    2626    include_package_data=True, 
    2727    test_suite='nose.collector', 
    28     tests_require=['webtest', 'beautifulsoup'], 
     28    tests_require=['WebTest', 'BeautifulSoup'], 
    2929    package_data={'{{package}}': ['i18n/*/LC_MESSAGES/*.mo', 
    3030                                 'templates/*/*',