15 lines
481 B
Python
15 lines
481 B
Python
from pathlib import Path
|
|
import unittest
|
|
|
|
|
|
class RingAllFrontendAuthTests(unittest.TestCase):
|
|
def test_ring_all_request_sends_session_token(self):
|
|
source = (Path(__file__).resolve().parents[1] / "static/js/map-account.js").read_text(encoding="utf-8")
|
|
request_block = source.split('apiFetch("/api/ring_all"', 1)[1].split(");", 1)[0]
|
|
|
|
self.assertIn('"Authorization": `Bearer ${authToken}`', request_block)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|