IPR title search with test cases and acceptable diffs

- Legacy-Id: 697
This commit is contained in:
Henrik Levkowetz 2007-06-27 14:12:54 +00:00
parent 760c1190e7
commit 188a562114
6 changed files with 51 additions and 1 deletions

View file

@ -174,7 +174,15 @@ def search(request, type="", q="", id=""):
# Search by title of IPR disclosure
# IPR list with documents
elif type == "ipr_title_search":
pass
iprs = IprDetail.objects.filter(title__icontains=q, status__in=[1,3]).order_by("-submitted_date", "-ipr_id")
count = iprs.count()
iprs = [ ipr for ipr in iprs if not ipr.updated_by.all() ]
# Some extra information, to help us render 'and' between the
# last two documents in a sequence
mark_last_doc(iprs)
return render("ipr/search_iprtitle_result.html", {"q": q, "iprs": iprs, "count": count },
context_instance=RequestContext(request) )
else:
raise ValueError("Unexpected search type in IPR query: %s" % type)
return django.http.HttpResponseRedirect(request.path)

View file

@ -10,22 +10,32 @@
200 /ipr/search/ https://datatracker.ietf.org/public/ipr_search.cgi
302 /ipr/search/?option=document_search # incomplete argument set gives redirect
200 /ipr/search/?document_search=mod&option=document_search https://datatracker.ietf.org/public/ipr_search.cgi?option=document_search&document_search=mod
200,sort /ipr/search/?id_document_tag=2220&option=document_search https://datatracker.ietf.org/public/ipr_search.cgi?option=document_search&id_document_tag=2220
200,sort /ipr/search/?rfc_search=1034&option=rfc_search https://datatracker.ietf.org/public/ipr_search.cgi?option=rfc_search&rfc_search=1034 # Loong result, RFC search
200 /ipr/search/?rfc_search=4444&option=rfc_search https://datatracker.ietf.org/public/ipr_search.cgi?option=rfc_search&rfc_search=4444 # Empty result, RFC search
200 /ipr/search/?patent_search=nortel&option=patent_search https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_search&patent_search=nortel
200 /ipr/search/?patent_search=nortelxz&option=patent_search https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_search&patent_search=nortelxz # Empty result
200,sort,ignore:quote /ipr/search/?wg_search=dnsext&option=wg_search https://datatracker.ietf.org/public/ipr_search.cgi?option=wg_search&wg_search=dnsext
#200,sort,ignore:quote /ipr/search/?wg_search=aaa&option=wg_search https://datatracker.ietf.org/public/ipr_search.cgi?option=wg_search&wg_search=aaa # FIXME This fails, needs revisiting
200,sort,ignore:quote /ipr/search/?wg_search=acct&option=wg_search https://datatracker.ietf.org/public/ipr_search.cgi?option=wg_search&wg_search=acct # Empty result
200,sort,ignore:quote /ipr/search/?option=title_search&title_search=AAA https://datatracker.ietf.org/public/ipr_search.cgi?option=title_search&title_search=AAA
200,sort,ignore:quote /ipr/search/?option=title_search&title_search=AAAxz https://datatracker.ietf.org/public/ipr_search.cgi?option=title_search&title_search=AAAxz # Empty result
200,sort /ipr/search/?patent_info_search=123&option=patent_info_search https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_info_search&patent_info_search=123
200,sort /ipr/search/?patent_info_search=31415&option=patent_info_search https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_info_search&patent_info_search=31415 # Empty result
200 /ipr/search/?patent_info_search=12&option=patent_info_search https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_info_search&patent_info_search=12 # Error: at least 3 characters
200 /ipr/search/?patent_info_search=abc&option=patent_info_search https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_info_search&patent_info_search=abc # Error: at least 1 digit
200 /ipr/search/?option=ipr_title_search&ipr_title_search=nortel https://datatracker.ietf.org/public/ipr_search.cgi?option=ipr_title_search&ipr_title_search=nortel
200 /ipr/search/?option=ipr_title_search&ipr_title_search=nortelxz https://datatracker.ietf.org/public/ipr_search.cgi?option=ipr_title_search&ipr_title_search=nortelxz # Empty result
200 /ipr/about/ https://datatracker.ietf.org/public/ipr_disclosure.cgi
200 /ipr/2006/

View file

@ -0,0 +1,6 @@
{% extends "ipr/search_result.html" %}
{% load ietf_filters %}
{% block search_header %}{% if not count %}Search result on {{ q }}{% else %}IPR Disclosure Title Search Result{% endif %}{% endblock %}</b></td></tr>
{% block intro_prefix %}IPR that{% endblock %}
{% block intro_suffix %}and has the string <b><i>"{{ q }}"</i></b> within the IPR disclosure title.{% endblock %}
{% block search_failed %}No IPR disclosures with the word(s) "<i>{{ q }}</i>" in the title have been submitted{% endblock %}

View file

@ -0,0 +1,12 @@
--- https://datatracker.ietf.org/public/ipr_search.cgi?option=ipr_title_search&ipr_title_search=nortel
+++ /ipr/search/?option=ipr_title_search&ipr_title_search=nortel
@@ -211,2 +211,2 @@
-IPR that has word(s) "nortel" in the title, and is not related to a
-specific IETF contribution.
+IPR that is not related to a specific IETF contribution. and has the
+string "nortel" within the IPR disclosure title.
@@ -217,2 +217,2 @@
-IPR that has word(s) "nortel" in the title, and is not related to a
-specific IETF contribution.
+IPR that is not related to a specific IETF contribution. and has the
+string "nortel" within the IPR disclosure title.

View file

@ -0,0 +1,10 @@
--- https://datatracker.ietf.org/public/ipr_search.cgi?option=ipr_title_search&ipr_title_search=nortelxz
+++ /ipr/search/?option=ipr_title_search&ipr_title_search=nortelxz
@@ -2,3 +2,5 @@
-Search result on "nortelxz"
-No IPR disclosures with the word(s)"nortelxz" in the title have been
-submitted.
+Search result on nortelxz
+No IPR disclosures with the word(s) "nortelxz" in the title have been
+submitted
+IPR Search Main Page IPR Disclosure Page

View file

@ -0,0 +1,4 @@
--- https://datatracker.ietf.org/public/ipr_search.cgi?option=patent_info_search&patent_info_search=12
+++ /ipr/search/?patent_info_search=12&option=patent_info_search
@@ -4,1 +4,1 @@
-Please send problem reports to ietf-action@ietf.org.