where's self.assertMatch (for Django)?

P

Phlip

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,
 
P

Phlip

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top