Ask and you shall receive.

PS: I think there is a test broken in tgdev. I'm getting an error at.
with Revision: 5460

  File 
"/home/elpargo/mramm/pc-one/projectone/tgdev/devtools/tests/test_pastetemplate.py",
line 36, in setup


On Thu, Oct 16, 2008 at 7:42 PM, Mark Ramm <[EMAIL PROTECTED]> wrote:
> I think we would almost definitely accept a patch that switches the tests to
> nose. ;)
>
>
> On Thu, Oct 16, 2008 at 8:30 PM, Jorge Vargas <[EMAIL PROTECTED]>
> wrote:
>>
>> Hi,
>>
>> I just spend a couple of minutes tracking down a "bug" that turned out
>> to be a feature of nose that isn't supported with TestCase subclasses
>> (test generators if you care)
>>
>> after a while i realized that the default quickstarted project is
>> using unittest instead of nose. I have "fixed" my local install but I
>> do think it should be the default.
>>
>>
>
>
>
> --
> Mark Ramm-Christensen
> email: mark at compoundthinking dot com
> blog: www.compoundthinking.com/blog
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Index: devtools/templates/turbogears/+package+/tests/functional/test_root.py_tmpl
===================================================================
--- devtools/templates/turbogears/+package+/tests/functional/test_root.py_tmpl	(revision 5460)
+++ devtools/templates/turbogears/+package+/tests/functional/test_root.py_tmpl	(working copy)
@@ -1,6 +1,7 @@
 # -*- coding: utf-8 -*-
 
 from {{package}}.tests import TestController
+from nose.tools import assert_true
 
 # This is an example of how you can write functional tests for your controller.
 # As opposed to a pure unit-test which test a small unit of functionallity,
@@ -13,7 +14,7 @@
         msg = 'TurboGears 2 is rapid web application development toolkit '\
               'designed to make your life easier.'
         # You can look for specific strings:
-        self.failUnless(msg in response)
-        # You cam also access a BeautifulSoup'ed version
+        assert_true(msg in response)
+        # You can also access a BeautifulSoup'ed version
         links = response.html.findAll('a')
-        self.failUnless(links, "Mummy, there are no links here!")
+        assert_true(links, "Mummy, there are no links here!")
Index: devtools/templates/turbogears/+package+/tests/__init__.py_tmpl
===================================================================
--- devtools/templates/turbogears/+package+/tests/__init__.py_tmpl	(revision 5460)
+++ devtools/templates/turbogears/+package+/tests/__init__.py_tmpl	(working copy)
@@ -10,7 +10,6 @@
 """
 import os
 import sys
-from unittest import TestCase
 
 import pkg_resources
 import webtest
@@ -32,9 +31,8 @@
 cmd = paste.script.appinstall.SetupCommand('setup-app')
 cmd.run([test_file])
 
-class TestController(TestCase):
+class TestController(object):
 
     def __init__(self, *args, **kwargs):
         wsgiapp = loadapp('config:test.ini', relative_to=conf_dir)
         self.app = webtest.TestApp(wsgiapp)
-        TestCase.__init__(self, *args, **kwargs)
Index: devtools/templates/turbogears/+package+/tests/test_models.py_tmpl
===================================================================
--- devtools/templates/turbogears/+package+/tests/test_models.py_tmpl	(revision 5460)
+++ devtools/templates/turbogears/+package+/tests/test_models.py_tmpl	(working copy)
@@ -2,6 +2,7 @@
 """Test suite for the TG app's models"""
 
 from tg.testutil import DBTest
+from nose.tools import eq_
 
 from {{package}} import model
 
@@ -23,20 +24,20 @@
         
     def test_member_creation_username(self):
         """The member constructor must set the user name right"""
-        self.assertEqual(self.member.user_name, u"ignucius")
+        eq_(self.member.user_name, u"ignucius")
         
     def test_member_creation_email(self):
         """The member constructor must set the email right"""
-        self.assertEqual(self.member.email_address, u"[EMAIL PROTECTED]")
+        eq_(self.member.email_address, u"[EMAIL PROTECTED]")
     
     def test_no_permissions_by_default(self):
         """User objects should have no permission by default."""
-        self.assertEqual(len(self.member.permissions), 0)
+        eq_(len(self.member.permissions), 0)
         
     def test_getting_by_email(self):
         """Users should be fetcheable by their email addresses"""
         model.DBSession.add(self.member)
         him = model.User.by_email_address(u"[EMAIL PROTECTED]")
-        self.assertEqual(him, self.member)
+        eq_(him, self.member)
 
 {{endif}}

Reply via email to