Added some new formats to the regex validator for patent numbers and patent application numbers. This is still not comprehensive.
- Legacy-Id: 16638
This commit is contained in:
parent
8e313e4ed5
commit
8f53f44953
|
@ -119,6 +119,10 @@ validate_patent_number = RegexValidator(
|
||||||
r"|[A-Z][A-Z]\d{6,12}([A-Z]\d?)?"
|
r"|[A-Z][A-Z]\d{6,12}([A-Z]\d?)?"
|
||||||
r"|[A-Z][A-Z]\d{4}(\w{1,2}\d{5,7})?"
|
r"|[A-Z][A-Z]\d{4}(\w{1,2}\d{5,7})?"
|
||||||
r"|[A-Z][A-Z]\d{15}"
|
r"|[A-Z][A-Z]\d{15}"
|
||||||
|
r"|[A-Z][A-Z][A-Z]\d{1,5}/\d{4}"
|
||||||
|
r"|[A-Z][A-Z]\d{1,4}/\d{1,4}"
|
||||||
|
r"|PCT/[A-Z][A-Z]\d{2}/\d{5}" # WO application, old
|
||||||
|
r"|PCT/[A-Z][A-Z]\d{4}/\d{6}" # WO application, new
|
||||||
r")[, ]*)+$"),
|
r")[, ]*)+$"),
|
||||||
message="Please enter one or more patent publication or application numbers as country code and serial number, e.g.: US62/123456 or WO2017123456." )
|
message="Please enter one or more patent publication or application numbers as country code and serial number, e.g.: US62/123456 or WO2017123456." )
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ class IprTests(TestCase):
|
||||||
|
|
||||||
# successful post
|
# successful post
|
||||||
empty_outbox()
|
empty_outbox()
|
||||||
r = self.client.post(url, {
|
data = {
|
||||||
"holder_legal_name": "Test Legal",
|
"holder_legal_name": "Test Legal",
|
||||||
"holder_contact_name": "Test Holder",
|
"holder_contact_name": "Test Holder",
|
||||||
"holder_contact_email": "test@holder.com",
|
"holder_contact_email": "test@holder.com",
|
||||||
|
@ -258,7 +258,8 @@ class IprTests(TestCase):
|
||||||
"licensing": "royalty-free",
|
"licensing": "royalty-free",
|
||||||
"submitter_name": "Test Holder",
|
"submitter_name": "Test Holder",
|
||||||
"submitter_email": "test@holder.com",
|
"submitter_email": "test@holder.com",
|
||||||
})
|
}
|
||||||
|
r = self.client.post(url, data)
|
||||||
self.assertContains(r, "Your IPR disclosure has been submitted")
|
self.assertContains(r, "Your IPR disclosure has been submitted")
|
||||||
|
|
||||||
iprs = IprDisclosureBase.objects.filter(title__icontains=draft.name)
|
iprs = IprDisclosureBase.objects.filter(title__icontains=draft.name)
|
||||||
|
@ -273,6 +274,19 @@ class IprTests(TestCase):
|
||||||
self.assertTrue('New IPR Submission' in outbox[0]['Subject'])
|
self.assertTrue('New IPR Submission' in outbox[0]['Subject'])
|
||||||
self.assertTrue('ietf-ipr@' in outbox[0]['To'])
|
self.assertTrue('ietf-ipr@' in outbox[0]['To'])
|
||||||
|
|
||||||
|
# Check some additional application number formats:
|
||||||
|
for patent_number in [
|
||||||
|
'PCT/EP2019/123456', # WO application
|
||||||
|
'PCT/EP05/12345', # WO application, old
|
||||||
|
'ATA123/2012', # Austria
|
||||||
|
'AU2011901234', # Australia
|
||||||
|
'BE2010/0912', # Belgium
|
||||||
|
'CA1234567', # Canada
|
||||||
|
]:
|
||||||
|
data['patent_number'] = patent_number
|
||||||
|
r = self.client.post(url, data)
|
||||||
|
self.assertContains(r, "Your IPR disclosure has been submitted", msg_prefix="Checked patent number: %s" % patent_number)
|
||||||
|
|
||||||
def test_new_thirdparty(self):
|
def test_new_thirdparty(self):
|
||||||
"""Add a new third-party disclosure. Note: submitter does not need to be logged in.
|
"""Add a new third-party disclosure. Note: submitter does not need to be logged in.
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue