Merge pull request #2727 from bdr99/disable-matching

Feature: Add an option to disable matching
This commit is contained in:
shamoon 2023-02-22 07:13:27 -08:00 committed by GitHub
commit 782db3f324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 170 additions and 37 deletions

View File

@ -9,7 +9,7 @@ Paperless will compare the matching algorithms defined by every tag,
correspondent, document type, and storage path in your database to see correspondent, document type, and storage path in your database to see
if they apply to the text in a document. In other words, if you define a if they apply to the text in a document. In other words, if you define a
tag called `Home Utility` that had a `match` property of `bc hydro` and tag called `Home Utility` that had a `match` property of `bc hydro` and
a `matching_algorithm` of `literal`, Paperless will automatically tag a `matching_algorithm` of `Exact`, Paperless will automatically tag
your newly-consumed document with your `Home Utility` tag so long as the your newly-consumed document with your `Home Utility` tag so long as the
text `bc hydro` appears in the body of the document somewhere. text `bc hydro` appears in the body of the document somewhere.
@ -25,12 +25,13 @@ documents.
The following algorithms are available: The following algorithms are available:
- **None:** No matching will be performed.
- **Any:** Looks for any occurrence of any word provided in match in - **Any:** Looks for any occurrence of any word provided in match in
the PDF. If you define the match as `Bank1 Bank2`, it will match the PDF. If you define the match as `Bank1 Bank2`, it will match
documents containing either of these terms. documents containing either of these terms.
- **All:** Requires that every word provided appears in the PDF, - **All:** Requires that every word provided appears in the PDF,
albeit not in the order provided. albeit not in the order provided.
- **Literal:** Matches only if the match appears exactly as provided - **Exact:** Matches only if the match appears exactly as provided
(i.e. preserve ordering) in the PDF. (i.e. preserve ordering) in the PDF.
- **Regular expression:** Parses the match as a regular expression and - **Regular expression:** Parses the match as a regular expression and
tries to find a match within the document. tries to find a match within the document.

View File

@ -1109,21 +1109,21 @@
<source>Create new item</source> <source>Create new item</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/common/edit-dialog/edit-dialog.component.ts</context> <context context-type="sourcefile">src/app/components/common/edit-dialog/edit-dialog.component.ts</context>
<context context-type="linenumber">67</context> <context context-type="linenumber">71</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="5324147361912094446" datatype="html"> <trans-unit id="5324147361912094446" datatype="html">
<source>Edit item</source> <source>Edit item</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/common/edit-dialog/edit-dialog.component.ts</context> <context context-type="sourcefile">src/app/components/common/edit-dialog/edit-dialog.component.ts</context>
<context context-type="linenumber">71</context> <context context-type="linenumber">75</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="1699589597032579396" datatype="html"> <trans-unit id="1699589597032579396" datatype="html">
<source>Could not save element: <x id="PH" equiv-text="error"/></source> <source>Could not save element: <x id="PH" equiv-text="error"/></source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/common/edit-dialog/edit-dialog.component.ts</context> <context context-type="sourcefile">src/app/components/common/edit-dialog/edit-dialog.component.ts</context>
<context context-type="linenumber">75</context> <context context-type="linenumber">79</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="7314814725704332646" datatype="html"> <trans-unit id="7314814725704332646" datatype="html">
@ -1498,7 +1498,7 @@
</context-group> </context-group>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context> <context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context>
<context context-type="linenumber">192</context> <context context-type="linenumber">195</context>
</context-group> </context-group>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/settings/settings.component.html</context> <context context-type="sourcefile">src/app/components/manage/settings/settings.component.html</context>
@ -2671,7 +2671,7 @@
</context-group> </context-group>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context> <context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context>
<context context-type="linenumber">188</context> <context context-type="linenumber">191</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="5382975254277698192" datatype="html"> <trans-unit id="5382975254277698192" datatype="html">
@ -3677,53 +3677,64 @@
<source>Automatic</source> <source>Automatic</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context> <context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context>
<context context-type="linenumber">98</context> <context context-type="linenumber">99</context>
</context-group> </context-group>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/data/matching-model.ts</context> <context context-type="sourcefile">src/app/data/matching-model.ts</context>
<context context-type="linenumber">39</context> <context context-type="linenumber">15</context>
</context-group>
</trans-unit>
<trans-unit id="6252070156626006029" datatype="html">
<source>None</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context>
<context context-type="linenumber">101</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/data/matching-model.ts</context>
<context context-type="linenumber">45</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="211408744872436427" datatype="html"> <trans-unit id="211408744872436427" datatype="html">
<source>Successfully created <x id="PH" equiv-text="this.typeName"/>.</source> <source>Successfully created <x id="PH" equiv-text="this.typeName"/>.</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context> <context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context>
<context context-type="linenumber">138</context> <context context-type="linenumber">141</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="6328828522970676938" datatype="html"> <trans-unit id="6328828522970676938" datatype="html">
<source>Error occurred while creating <x id="PH" equiv-text="this.typeName"/> : <x id="PH_1" equiv-text="e.toString()"/>.</source> <source>Error occurred while creating <x id="PH" equiv-text="this.typeName"/> : <x id="PH_1" equiv-text="e.toString()"/>.</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context> <context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context>
<context context-type="linenumber">143,145</context> <context context-type="linenumber">146,148</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="2541368547549828690" datatype="html"> <trans-unit id="2541368547549828690" datatype="html">
<source>Successfully updated <x id="PH" equiv-text="this.typeName"/>.</source> <source>Successfully updated <x id="PH" equiv-text="this.typeName"/>.</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context> <context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context>
<context context-type="linenumber">161</context> <context context-type="linenumber">164</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="6151710751857751783" datatype="html"> <trans-unit id="6151710751857751783" datatype="html">
<source>Error occurred while saving <x id="PH" equiv-text="this.typeName"/> : <x id="PH_1" equiv-text="e.toString()"/>.</source> <source>Error occurred while saving <x id="PH" equiv-text="this.typeName"/> : <x id="PH_1" equiv-text="e.toString()"/>.</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context> <context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context>
<context context-type="linenumber">166,168</context> <context context-type="linenumber">169,171</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="4012132330507560812" datatype="html"> <trans-unit id="4012132330507560812" datatype="html">
<source>Do you really want to delete the <x id="PH" equiv-text="this.typeName"/>?</source> <source>Do you really want to delete the <x id="PH" equiv-text="this.typeName"/>?</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context> <context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context>
<context context-type="linenumber">175</context> <context context-type="linenumber">178</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="8371896857609524947" datatype="html"> <trans-unit id="8371896857609524947" datatype="html">
<source>Associated documents will not be deleted.</source> <source>Associated documents will not be deleted.</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context> <context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context>
<context context-type="linenumber">190</context> <context context-type="linenumber">193</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="5467489005440577210" datatype="html"> <trans-unit id="5467489005440577210" datatype="html">
@ -3732,7 +3743,7 @@
)"/></source> )"/></source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context> <context context-type="sourcefile">src/app/components/manage/management-list/management-list.component.ts</context>
<context context-type="linenumber">203,205</context> <context context-type="linenumber">206,208</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="1685061484835793745" datatype="html"> <trans-unit id="1685061484835793745" datatype="html">
@ -4501,81 +4512,88 @@
<context context-type="linenumber">7</context> <context context-type="linenumber">7</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="2167862279705099846" datatype="html">
<source>Auto: Learn matching automatically</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/data/matching-model.ts</context>
<context context-type="linenumber">16</context>
</context-group>
</trans-unit>
<trans-unit id="5851669019930456395" datatype="html"> <trans-unit id="5851669019930456395" datatype="html">
<source>Any word</source> <source>Any word</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/data/matching-model.ts</context> <context context-type="sourcefile">src/app/data/matching-model.ts</context>
<context context-type="linenumber">14</context> <context context-type="linenumber">20</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="7517655726614958140" datatype="html"> <trans-unit id="7517655726614958140" datatype="html">
<source>Any: Document contains any of these words (space separated)</source> <source>Any: Document contains any of these words (space separated)</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/data/matching-model.ts</context> <context context-type="sourcefile">src/app/data/matching-model.ts</context>
<context context-type="linenumber">15</context> <context context-type="linenumber">21</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="700315718208181326" datatype="html"> <trans-unit id="700315718208181326" datatype="html">
<source>All words</source> <source>All words</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/data/matching-model.ts</context> <context context-type="sourcefile">src/app/data/matching-model.ts</context>
<context context-type="linenumber">19</context> <context context-type="linenumber">25</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="111914402588955480" datatype="html"> <trans-unit id="111914402588955480" datatype="html">
<source>All: Document contains all of these words (space separated)</source> <source>All: Document contains all of these words (space separated)</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/data/matching-model.ts</context> <context context-type="sourcefile">src/app/data/matching-model.ts</context>
<context context-type="linenumber">20</context> <context context-type="linenumber">26</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="9180173992399180575" datatype="html"> <trans-unit id="9180173992399180575" datatype="html">
<source>Exact match</source> <source>Exact match</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/data/matching-model.ts</context> <context context-type="sourcefile">src/app/data/matching-model.ts</context>
<context context-type="linenumber">24</context> <context context-type="linenumber">30</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="7109184332944610787" datatype="html"> <trans-unit id="7109184332944610787" datatype="html">
<source>Exact: Document contains this string</source> <source>Exact: Document contains this string</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/data/matching-model.ts</context> <context context-type="sourcefile">src/app/data/matching-model.ts</context>
<context context-type="linenumber">25</context> <context context-type="linenumber">31</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="1338733395833138319" datatype="html"> <trans-unit id="1338733395833138319" datatype="html">
<source>Regular expression</source> <source>Regular expression</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/data/matching-model.ts</context> <context context-type="sourcefile">src/app/data/matching-model.ts</context>
<context context-type="linenumber">29</context> <context context-type="linenumber">35</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="7548151332424148033" datatype="html"> <trans-unit id="7548151332424148033" datatype="html">
<source>Regular expression: Document matches this regular expression</source> <source>Regular expression: Document matches this regular expression</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/data/matching-model.ts</context> <context context-type="sourcefile">src/app/data/matching-model.ts</context>
<context context-type="linenumber">30</context> <context context-type="linenumber">36</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="1856513373880048959" datatype="html"> <trans-unit id="1856513373880048959" datatype="html">
<source>Fuzzy word</source> <source>Fuzzy word</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/data/matching-model.ts</context> <context context-type="sourcefile">src/app/data/matching-model.ts</context>
<context context-type="linenumber">34</context> <context context-type="linenumber">40</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="8419167206585286450" datatype="html"> <trans-unit id="8419167206585286450" datatype="html">
<source>Fuzzy: Document contains a word similar to this word</source> <source>Fuzzy: Document contains a word similar to this word</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/data/matching-model.ts</context> <context context-type="sourcefile">src/app/data/matching-model.ts</context>
<context context-type="linenumber">35</context> <context context-type="linenumber">41</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="2167862279705099846" datatype="html"> <trans-unit id="8233576851457338601" datatype="html">
<source>Auto: Learn matching automatically</source> <source>None: Disable matching</source>
<context-group purpose="location"> <context-group purpose="location">
<context context-type="sourcefile">src/app/data/matching-model.ts</context> <context context-type="sourcefile">src/app/data/matching-model.ts</context>
<context context-type="linenumber">40</context> <context context-type="linenumber">46</context>
</context-group> </context-group>
</trans-unit> </trans-unit>
<trans-unit id="5948496158474272829" datatype="html"> <trans-unit id="5948496158474272829" datatype="html">

View File

@ -2,7 +2,11 @@ import { Directive, EventEmitter, Input, OnInit, Output } from '@angular/core'
import { FormGroup } from '@angular/forms' import { FormGroup } from '@angular/forms'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap' import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { Observable } from 'rxjs' import { Observable } from 'rxjs'
import { MATCHING_ALGORITHMS, MATCH_AUTO } from 'src/app/data/matching-model' import {
MATCHING_ALGORITHMS,
MATCH_AUTO,
MATCH_NONE,
} from 'src/app/data/matching-model'
import { ObjectWithId } from 'src/app/data/object-with-id' import { ObjectWithId } from 'src/app/data/object-with-id'
import { ObjectWithPermissions } from 'src/app/data/object-with-permissions' import { ObjectWithPermissions } from 'src/app/data/object-with-permissions'
import { PaperlessUser } from 'src/app/data/paperless-user' import { PaperlessUser } from 'src/app/data/paperless-user'
@ -91,7 +95,10 @@ export abstract class EditDialogComponent<
} }
get patternRequired(): boolean { get patternRequired(): boolean {
return this.objectForm?.value.matching_algorithm !== MATCH_AUTO return (
this.objectForm?.value.matching_algorithm !== MATCH_AUTO &&
this.objectForm?.value.matching_algorithm !== MATCH_NONE
)
} }
save() { save() {

View File

@ -12,6 +12,7 @@ import {
MatchingModel, MatchingModel,
MATCHING_ALGORITHMS, MATCHING_ALGORITHMS,
MATCH_AUTO, MATCH_AUTO,
MATCH_NONE,
} from 'src/app/data/matching-model' } from 'src/app/data/matching-model'
import { ObjectWithId } from 'src/app/data/object-with-id' import { ObjectWithId } from 'src/app/data/object-with-id'
import { ObjectWithPermissions } from 'src/app/data/object-with-permissions' import { ObjectWithPermissions } from 'src/app/data/object-with-permissions'
@ -96,6 +97,8 @@ export abstract class ManagementListComponent<T extends ObjectWithId>
getMatching(o: MatchingModel) { getMatching(o: MatchingModel) {
if (o.matching_algorithm == MATCH_AUTO) { if (o.matching_algorithm == MATCH_AUTO) {
return $localize`Automatic` return $localize`Automatic`
} else if (o.matching_algorithm == MATCH_NONE) {
return $localize`None`
} else if (o.match && o.match.length > 0) { } else if (o.match && o.match.length > 0) {
return `${ return `${
MATCHING_ALGORITHMS.find((a) => a.id == o.matching_algorithm).shortName MATCHING_ALGORITHMS.find((a) => a.id == o.matching_algorithm).shortName

View File

@ -1,5 +1,6 @@
import { ObjectWithPermissions } from './object-with-permissions' import { ObjectWithId } from './object-with-id'
export const MATCH_NONE = 0
export const MATCH_ANY = 1 export const MATCH_ANY = 1
export const MATCH_ALL = 2 export const MATCH_ALL = 2
export const MATCH_LITERAL = 3 export const MATCH_LITERAL = 3
@ -9,6 +10,11 @@ export const MATCH_AUTO = 6
export const DEFAULT_MATCHING_ALGORITHM = MATCH_AUTO export const DEFAULT_MATCHING_ALGORITHM = MATCH_AUTO
export const MATCHING_ALGORITHMS = [ export const MATCHING_ALGORITHMS = [
{
id: MATCH_AUTO,
shortName: $localize`Automatic`,
name: $localize`Auto: Learn matching automatically`,
},
{ {
id: MATCH_ANY, id: MATCH_ANY,
shortName: $localize`Any word`, shortName: $localize`Any word`,
@ -35,13 +41,13 @@ export const MATCHING_ALGORITHMS = [
name: $localize`Fuzzy: Document contains a word similar to this word`, name: $localize`Fuzzy: Document contains a word similar to this word`,
}, },
{ {
id: MATCH_AUTO, id: MATCH_NONE,
shortName: $localize`Automatic`, shortName: $localize`None`,
name: $localize`Auto: Learn matching automatically`, name: $localize`None: Disable matching`,
}, },
] ]
export interface MatchingModel extends ObjectWithPermissions { export interface MatchingModel extends ObjectWithId {
name?: string name?: string
slug?: string slug?: string

View File

@ -86,7 +86,10 @@ def matches(matching_model, document):
if matching_model.is_insensitive: if matching_model.is_insensitive:
search_kwargs = {"flags": re.IGNORECASE} search_kwargs = {"flags": re.IGNORECASE}
if matching_model.matching_algorithm == MatchingModel.MATCH_ALL: if matching_model.matching_algorithm == MatchingModel.MATCH_NONE:
return False
elif matching_model.matching_algorithm == MatchingModel.MATCH_ALL:
for word in _split_match(matching_model): for word in _split_match(matching_model):
search_result = re.search(rf"\b{word}\b", document_content, **search_kwargs) search_result = re.search(rf"\b{word}\b", document_content, **search_kwargs)
if not search_result: if not search_result:

View File

@ -0,0 +1,81 @@
# Generated by Django 4.1.7 on 2023-02-22 00:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("documents", "1031_remove_savedview_user_correspondent_owner_and_more"),
]
operations = [
migrations.AlterField(
model_name="correspondent",
name="matching_algorithm",
field=models.PositiveIntegerField(
choices=[
(0, "None"),
(1, "Any word"),
(2, "All words"),
(3, "Exact match"),
(4, "Regular expression"),
(5, "Fuzzy word"),
(6, "Automatic"),
],
default=1,
verbose_name="matching algorithm",
),
),
migrations.AlterField(
model_name="documenttype",
name="matching_algorithm",
field=models.PositiveIntegerField(
choices=[
(0, "None"),
(1, "Any word"),
(2, "All words"),
(3, "Exact match"),
(4, "Regular expression"),
(5, "Fuzzy word"),
(6, "Automatic"),
],
default=1,
verbose_name="matching algorithm",
),
),
migrations.AlterField(
model_name="storagepath",
name="matching_algorithm",
field=models.PositiveIntegerField(
choices=[
(0, "None"),
(1, "Any word"),
(2, "All words"),
(3, "Exact match"),
(4, "Regular expression"),
(5, "Fuzzy word"),
(6, "Automatic"),
],
default=1,
verbose_name="matching algorithm",
),
),
migrations.AlterField(
model_name="tag",
name="matching_algorithm",
field=models.PositiveIntegerField(
choices=[
(0, "None"),
(1, "Any word"),
(2, "All words"),
(3, "Exact match"),
(4, "Regular expression"),
(5, "Fuzzy word"),
(6, "Automatic"),
],
default=1,
verbose_name="matching algorithm",
),
),
]

View File

@ -24,6 +24,7 @@ TASK_STATE_CHOICES = sorted(zip(ALL_STATES, ALL_STATES))
class MatchingModel(models.Model): class MatchingModel(models.Model):
MATCH_NONE = 0
MATCH_ANY = 1 MATCH_ANY = 1
MATCH_ALL = 2 MATCH_ALL = 2
MATCH_LITERAL = 3 MATCH_LITERAL = 3
@ -32,6 +33,7 @@ class MatchingModel(models.Model):
MATCH_AUTO = 6 MATCH_AUTO = 6
MATCHING_ALGORITHMS = ( MATCHING_ALGORITHMS = (
(MATCH_NONE, _("None")),
(MATCH_ANY, _("Any word")), (MATCH_ANY, _("Any word")),
(MATCH_ALL, _("All words")), (MATCH_ALL, _("All words")),
(MATCH_LITERAL, _("Exact match")), (MATCH_LITERAL, _("Exact match")),

View File

@ -47,6 +47,18 @@ class _TestMatchingBase(TestCase):
class TestMatching(_TestMatchingBase): class TestMatching(_TestMatchingBase):
def test_match_none(self):
self._test_matching(
"",
"MATCH_NONE",
(),
(
"no",
"match",
),
)
def test_match_all(self): def test_match_all(self):
self._test_matching( self._test_matching(