@@ -339,14 +339,17 @@ def test_invalid_indexer(self):
339
339
# mangle things so we can test AssertionError at end
340
340
# get_indexer()
341
341
from roundup .configuration import IndexerOption
342
- IndexerOption .allowed .append ("unrecognized_indexer" )
342
+ io_orig = IndexerOption .allowed
343
+ io = list (io_orig )
344
+ io .append ("unrecognized_indexer" )
345
+ IndexerOption .allowed = tuple (io )
343
346
self .db .config ['INDEXER' ] = "unrecognized_indexer"
344
347
345
348
with self .assertRaises (AssertionError ) as cm :
346
349
indexer = get_indexer (self .db .config , self .db )
347
350
348
351
# unmangle state
349
- IndexerOption .allowed . pop ()
352
+ IndexerOption .allowed = io_orig
350
353
self .assertNotIn ("unrecognized_indexer" , IndexerOption .allowed )
351
354
self .db .config ['INDEXER' ] = ""
352
355
@@ -580,7 +583,10 @@ def test_invalid_language(self):
580
583
import psycopg2
581
584
582
585
from roundup .configuration import IndexerOption
583
- IndexerOption .valid_langs .append ("foo" )
586
+ io_orig = IndexerOption .valid_langs
587
+
588
+ io = list (io_orig )
589
+ io .append ("foo" )
584
590
self .db .config ["INDEXER_LANGUAGE" ] = "foo"
585
591
586
592
with self .assertRaises (psycopg2 .errors .UndefinedObject ) as ctx :
@@ -596,6 +602,7 @@ def test_invalid_language(self):
596
602
self .db .rollback ()
597
603
598
604
self .db .config ["INDEXER_LANGUAGE" ] = "english"
605
+ IndexerOption .valid_langs = io_orig
599
606
600
607
def testNullChar (self ):
601
608
"""Test with null char in string. Postgres FTS throws a ValueError
0 commit comments