[tests] Fix assertRaises tests in api_tests.py
[tests] Fix assertRaises tests in api_tests.py

Bug: T267801
Change-Id: I70e650df3ffe488bf8ccfb029c0844bf61f7e4ae

wikimedia/pywikibot-core,wikimedia/pywikibot-core