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:
Henrik Levkowetz 2019-08-09 20:10:06 +00:00
parent 8e313e4ed5
commit 8f53f44953
2 changed files with 20 additions and 2 deletions

View file

@ -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{4}(\w{1,2}\d{5,7})?"
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")[, ]*)+$"),
message="Please enter one or more patent publication or application numbers as country code and serial number, e.g.: US62/123456 or WO2017123456." )

View file

@ -238,7 +238,7 @@ class IprTests(TestCase):
# successful post
empty_outbox()
r = self.client.post(url, {
data = {
"holder_legal_name": "Test Legal",
"holder_contact_name": "Test Holder",
"holder_contact_email": "test@holder.com",
@ -258,7 +258,8 @@ class IprTests(TestCase):
"licensing": "royalty-free",
"submitter_name": "Test Holder",
"submitter_email": "test@holder.com",
})
}
r = self.client.post(url, data)
self.assertContains(r, "Your IPR disclosure has been submitted")
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('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):
"""Add a new third-party disclosure. Note: submitter does not need to be logged in.
"""