Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > where's self.assertMatch (for Django)?

Reply
Thread Tools

where's self.assertMatch (for Django)?

 
 
Phlip
Guest
Posts: n/a
 
      10-14-2009
Hypo Nt:

Been a while, now I'm back, and the first helpless question is...

When I google (including codesearch) for assertMatch, I get a mishmash of
opinions. Am I missing the One True assertMatch(), or isn't there one and I
gotta write it? or copy and use one of the pretenders?

Distractingly-yrs,

--
Phlip
http://zeekland.zeroplayer.com/Pigleg_Too/1
 
Reply With Quote
 
 
 
 
Phlip
Guest
Posts: n/a
 
      10-15-2009
> When I google (including codesearch) for assertMatch, I get a mishmash of
> opinions. Am I missing the One True assertMatch(), or isn't there one and I
> gotta write it? or copy and use one of the pretenders?


Ookay, try this:

def assertMatch(self, pattern, slug):
r = re.compile(pattern)
self.assertNotEqual(None, r.search(smart_str(slug)))

To do: Pass thru an optional diagnostic message.

Anyone know why this is not in PyUnit?

> --
> * *Phlip
> * *http://zeekland.zeroplayer.com/Pigleg_Too/1


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments