-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_parser.py
More file actions
665 lines (578 loc) · 24.9 KB
/
test_parser.py
File metadata and controls
665 lines (578 loc) · 24.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
import os
from datetime import datetime
from unittest import TestCase, mock
import pytest
import requests
from pytz import utc
from sr_invoice_parser.exceptions import ParserParseException, ParserRequestException
from sr_invoice_parser.parser import InvoiceParser
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
def read_example_response():
with open(os.path.join(__location__, "example_response.html"), "rb") as file:
content = file.read()
return content
EXAMPLE_INVOICE_TEXT = """<pre style="font-family:monospace">============ ФИСКАЛНИ РАЧУН ============
123456789
OKOV INTERNATIONAL
Primer naziva firme
Кнеза Михаила
Београд-Београд
Касир: prodavac1
ИД купца: 10:987654321
ЕСИР број: 644/20.1
-------------ПРОМЕТ ПРОДАЈА-------------
Артикли
========================================
Назив Цена Кол. Укупно
Veoma dugačak naziv artikla za testiranj
e test 1 (Ђ)
4.000,00 1 4.000,00
Veoma dugačak naziv artikla za testiranj
test 2 (Ђ)
1.000,00 1 1.000,00
Kratak naziv artikla 1 (Е)
1.960,00 1 1.960,00
Kratak naziv artikla 2 (G)
1.000,00 1 1.000,00
Kratak naziv artikla 3 (A)
1.000,00 1 1.000,00
----------------------------------------
Укупан износ: 8.960,00
Платна картица: 8.960,00
========================================
Ознака Име Стопа Порез
Ђ О-ПДВ 20,00% 500,00
Е О-ПДВ 10,00% 196,00
A О-ПДВ 0,00% 0,00
G О-ПДВ 0,00% 0,00
----------------------------------------
Укупан износ пореза: 696,00
========================================
ПФР време: 07.04.2024. 17:00:30
ПФР број рачуна: QWERTY1U-QWERTY1U-18855
3
Бројач рачуна: 175097/188553ПП
========================================<br><img src="data:image/gif;base64" width="250" height="250">
======== КРАЈ ФИСКАЛНОГ РАЧУНА =========</pre>"""
def create_example_json_data():
"""Create example JSON data matching the HTML example response"""
return {
"invoiceRequest": {
"businessName": "Primer naziva firme",
"taxId": "123456789",
"buyer": "987654321",
},
"invoiceResult": {
"totalAmount": 8960.0,
"sdcTime": "2024-04-07T15:00:30Z",
"invoiceNumber": "QWERTYU1-QWERTYU1-12345",
},
"journal": EXAMPLE_INVOICE_TEXT,
}
class TestParser(TestCase):
def setUp(self):
super().setUp()
self.example_response = read_example_response()
def create_success_mock_response(self, use_json=False):
mock_response = mock.Mock()
mock_response.status_code = 200
mock_response.text = self.example_response
mock_response.content = self.example_response # For HTML fetching
if use_json:
mock_response.json.return_value = create_example_json_data()
return mock_response
def create_wrong_mock_response(self, use_json=False):
mock_response = mock.Mock()
mock_response.status_code = 200
mock_response.text = "Bad mock response"
if use_json:
# Return non-empty dict so json_data is truthy but has wrong structure
mock_response.json.return_value = {"invalid": "data"}
return mock_response
def test_init_no_url_and_html(self):
"""Test that an exception is raised when no URL or HTML content is provided"""
with pytest.raises(
ParserParseException, match="URL or HTML content is required"
):
InvoiceParser()
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_init_url_with_json_false(self, mock_get):
"""Test that URL with json=False fetches HTML instead of JSON"""
mock_get.return_value = self.create_success_mock_response()
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?", json=False)
assert parser.json_data is None
assert parser.html_selector is not None
assert parser.use_json is False
mock_get.assert_called_once_with(
"https://suf.purs.gov.rs/v/vl?", headers=None, timeout=30
)
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_init_url_with_json_true(self, mock_get):
"""Test that URL with json=True (default) fetches JSON"""
mock_get.return_value = self.create_success_mock_response(use_json=True)
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?", json=True)
assert parser.json_data is not None
assert parser.html_selector is None
assert parser.use_json is True
mock_get.assert_called_once_with(
"https://suf.purs.gov.rs/v/vl?",
headers={"Accept": "application/json"},
timeout=30,
)
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_validate_url(self, mock_get) -> None:
"""Test that the validate_url method works as expected"""
with pytest.raises(ParserRequestException, match="Invalid domain"):
InvoiceParser(url="https://example.com").validate_url()
mock_get.return_value = self.create_success_mock_response(use_json=True)
InvoiceParser(url="https://suf.purs.gov.rs/v/vl?").validate_url()
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_fetch_failed_with_400(self, mock_get):
# Create a mock response that raises HTTPError on raise_for_status()
mock_response = mock.Mock()
mock_response.status_code = 400
mock_response.raise_for_status.side_effect = requests.HTTPError(
"400 Client Error"
)
mock_get.return_value = mock_response
with pytest.raises(ParserRequestException, match="Request failed"):
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
parser.fetch()
mock_get.assert_called_once_with(
"https://suf.purs.gov.rs/v/vl?",
headers={"Accept": "application/json"},
timeout=30,
)
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_fetch_json_response(self, mock_get):
# Create a mock response for JSON fetch
mock_response = mock.Mock()
mock_response.status_code = 200
mock_response.json.return_value = {"key": "value"}
mock_get.return_value = mock_response
parser = InvoiceParser(html_text="Example HTML content")
parser.url = "https://suf.purs.gov.rs/v/vl?"
parser.fetch()
assert parser.json_data == {"key": "value"}
mock_get.assert_called_once_with(
"https://suf.purs.gov.rs/v/vl?",
headers={"Accept": "application/json"},
timeout=30,
)
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_fetch_html_response(self, mock_get):
# Create a mock response for HTML fetch
mock_response = mock.Mock()
mock_response.status_code = 200
mock_response.content = b"<html>test</html>"
mock_get.return_value = mock_response
parser = InvoiceParser(html_text="Example HTML content")
parser.url = "https://suf.purs.gov.rs/v/vl?"
parser.use_json = False
parser.fetch()
assert parser.html_selector is not None
assert parser.json_data is None
mock_get.assert_called_once_with(
"https://suf.purs.gov.rs/v/vl?", headers=None, timeout=30
)
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_company_name_failed(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_wrong_mock_response(use_json=True)
# test with URL
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
with pytest.raises(
ParserParseException,
match="Failed to parse the HTML content in 'get_company_name': 'invoiceRequest'",
):
parser.get_company_name()
# test with HTML content
parser = InvoiceParser(html_text="Bad HTML content")
with pytest.raises(
ParserParseException,
match="Failed to parse the HTML content in 'get_company_name': 'NoneType' object has no attribute 'strip'",
):
parser.get_company_name()
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_company_name(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_success_mock_response(use_json=True)
value = "Primer naziva firme"
# test with URL (uses JSON)
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
assert parser.get_company_name() == value
# test with HTML content
parser = InvoiceParser(html_text=self.example_response)
assert parser.get_company_name() == value
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_company_tin_failed(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_wrong_mock_response(use_json=True)
# test with URL
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
with pytest.raises(
ParserParseException,
match="Failed to parse the HTML content in 'get_company_tin': 'invoiceRequest'",
):
parser.get_company_tin()
# test with HTML content
parser = InvoiceParser(html_text="Bad HTML content")
with pytest.raises(
ParserParseException,
match="Failed to parse the HTML content in 'get_company_tin': 'NoneType' object has no attribute 'strip'",
):
parser.get_company_tin()
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_company_tin(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_success_mock_response(use_json=True)
value = "123456789"
# test with URL (uses JSON)
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
assert parser.get_company_tin() == value
# test with HTML content
parser = InvoiceParser(html_text=self.example_response)
assert parser.get_company_tin() == value
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_buyer_tin(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_success_mock_response(use_json=True)
value = "987654321"
# test with URL (uses JSON)
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
assert parser.get_buyer_tin() == value
# test with HTML content
parser = InvoiceParser(html_text=self.example_response)
assert parser.get_buyer_tin() == value
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_total_amount_failed(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_wrong_mock_response(use_json=True)
# test with URL
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
with pytest.raises(
ParserParseException,
match="Failed to parse the HTML content in 'get_total_amount': 'invoiceResult'",
):
parser.get_total_amount()
# test with HTML content
parser = InvoiceParser(html_text="Bad HTML content")
with pytest.raises(
ParserParseException,
match="Failed to parse the HTML content in 'get_total_amount': 'NoneType' object has no attribute 'strip'",
):
parser.get_total_amount()
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_total_amount(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_success_mock_response(use_json=True)
value = float(8960.0)
# test with URL (uses JSON)
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
assert parser.get_total_amount() == value
# test with HTML content
parser = InvoiceParser(html_text=self.example_response)
assert parser.get_total_amount() == value
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_dt_failed(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_wrong_mock_response(use_json=True)
# test with URL
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
with pytest.raises(
ParserParseException,
match="Failed to parse the HTML content in 'get_dt': 'invoiceResult'",
):
parser.get_dt()
# test with HTML content
parser = InvoiceParser(html_text="Bad HTML content")
with pytest.raises(
ParserParseException,
match="Failed to parse the HTML content in 'get_dt': 'NoneType' object has no attribute 'strip'",
):
parser.get_dt()
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_dt(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_success_mock_response(use_json=True)
value = datetime(2024, 4, 7, 15, 0, 30).replace(tzinfo=utc)
# test with URL (uses JSON)
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
assert parser.get_dt() == value
# test with HTML content
parser = InvoiceParser(html_text=self.example_response)
assert parser.get_dt() == value
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_invoice_number_failed(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_wrong_mock_response(use_json=True)
# test with URL
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
with pytest.raises(
ParserParseException,
match="Failed to parse the HTML content in 'get_invoice_number': 'invoiceResult'",
):
parser.get_invoice_number()
# test with HTML content
parser = InvoiceParser(html_text="Bad HTML content")
with pytest.raises(
ParserParseException,
match="Failed to parse the HTML content in 'get_invoice_number': 'NoneType' object has no attribute 'strip'",
):
parser.get_invoice_number()
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_invoice_number(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_success_mock_response(use_json=True)
value = "QWERTYU1-QWERTYU1-12345"
# test with URL (uses JSON)
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
assert parser.get_invoice_number() == value
# test with HTML content
parser = InvoiceParser(html_text=self.example_response)
assert parser.get_invoice_number() == value
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_invoice_text_failed(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_wrong_mock_response(use_json=True)
# test with URL
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
with pytest.raises(
ParserParseException,
match="Failed to parse the HTML content in 'get_invoice_text': 'journal'",
):
parser.get_invoice_text()
# test with HTML content
parser = InvoiceParser(html_text="Bad HTML content")
with pytest.raises(
ParserParseException,
match="Failed to parse the HTML content in 'get_invoice_text': 'NoneType' object has no attribute 'strip'",
):
parser.get_invoice_text()
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_invoice_text(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_success_mock_response(use_json=True)
# test with URL (uses JSON)
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
assert parser.get_invoice_text() == EXAMPLE_INVOICE_TEXT
# test with HTML content (expected value includes <pre> wrapper from HTML)
html_value = """<pre style="font-family:monospace">============ ФИСКАЛНИ РАЧУН ============
123456789
OKOV INTERNATIONAL
Primer naziva firme
Кнеза Михаила
Београд-Београд
Касир: prodavac1
ИД купца: 10:987654321
ЕСИР број: 644/20.1
-------------ПРОМЕТ ПРОДАЈА-------------
Артикли
========================================
Назив Цена Кол. Укупно
Veoma dugačak naziv artikla za testiranj
e test 1 (Ђ)
4.000,00 1 4.000,00
Veoma dugačak naziv artikla za testiranj
test 2 (Ђ)
1.000,00 1 1.000,00
Kratak naziv artikla 1 (Е)
1.960,00 1 1.960,00
Kratak naziv artikla 2 (G)
1.000,00 1 1.000,00
Kratak naziv artikla 3 (A)
1.000,00 1 1.000,00
----------------------------------------
Укупан износ: 8.960,00
Платна картица: 8.960,00
========================================
Ознака Име Стопа Порез
Ђ О-ПДВ 20,00% 500,00
Е О-ПДВ 10,00% 196,00
A О-ПДВ 0,00% 0,00
G О-ПДВ 0,00% 0,00
----------------------------------------
Укупан износ пореза: 696,00
========================================
ПФР време: 07.04.2024. 17:00:30
ПФР број рачуна: QWERTY1U-QWERTY1U-18855
3
Бројач рачуна: 175097/188553ПП
========================================<br><img src="data:image/gif;base64" width="250" height="250">
======== КРАЈ ФИСКАЛНОГ РАЧУНА =========</pre>"""
parser = InvoiceParser(html_text=self.example_response)
assert parser.get_invoice_text() == html_value
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_items_failed(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_wrong_mock_response(use_json=True)
# test with URL
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
with pytest.raises(
ParserParseException,
match="Failed to parse the HTML content in 'get_items': Failed to parse the HTML content in 'get_invoice_text': 'journal'",
):
parser.get_items()
# test with HTML content
parser = InvoiceParser(html_text="Bad HTML content")
with pytest.raises(
ParserParseException,
match="Failed to parse the HTML content in 'get_items': Failed to parse the HTML content in 'get_invoice_text': 'NoneType' object has no attribute 'strip'",
):
parser.get_items()
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_items(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_success_mock_response(use_json=True)
value = [
{
"name": "Veoma dugačak naziv artikla za testiranje test 1",
"vat": 20,
"price": 4000.0,
"quantity": 1,
"total_price": 4000.0,
},
{
"name": "Veoma dugačak naziv artikla za testiranj test 2",
"vat": 20,
"price": 1000.0,
"quantity": 1,
"total_price": 1000.0,
},
{
"name": "Kratak naziv artikla 1",
"vat": 10,
"price": 1960.0,
"quantity": 1,
"total_price": 1960.0,
},
{
"name": "Kratak naziv artikla 2",
"vat": 0,
"price": 1000.0,
"quantity": 1,
"total_price": 1000.0,
},
{
"name": "Kratak naziv artikla 3",
"vat": 0,
"price": 1000.0,
"quantity": 1,
"total_price": 1000.0,
},
]
# test with URL (uses JSON)
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
assert parser.get_items() == value
# test with HTML content
parser = InvoiceParser(html_text=self.example_response)
assert parser.get_items() == value
@mock.patch("sr_invoice_parser.parser.requests.get")
def test_get_data(self, mock_get):
# Create a mock response
mock_get.return_value = self.create_success_mock_response(use_json=True)
invoice_items = [
{
"name": "Veoma dugačak naziv artikla za testiranje test 1",
"vat": 20,
"price": 4000.0,
"quantity": 1,
"total_price": 4000.0,
},
{
"name": "Veoma dugačak naziv artikla za testiranj test 2",
"vat": 20,
"price": 1000.0,
"quantity": 1,
"total_price": 1000.0,
},
{
"name": "Kratak naziv artikla 1",
"vat": 10,
"price": 1960.0,
"quantity": 1,
"total_price": 1960.0,
},
{
"name": "Kratak naziv artikla 2",
"vat": 0,
"price": 1000.0,
"quantity": 1,
"total_price": 1000.0,
},
{
"name": "Kratak naziv artikla 3",
"vat": 0,
"price": 1000.0,
"quantity": 1,
"total_price": 1000.0,
},
]
# test with URL (uses JSON)
json_value = {
"company_name": "Primer naziva firme",
"company_tin": "123456789",
"buyer_tin": "987654321",
"invoice_number": "QWERTYU1-QWERTYU1-12345",
"invoice_datetime": datetime(2024, 4, 7, 15, 0, 30).replace(tzinfo=utc),
"invoice_total_amount": 8960.0,
"invoice_items": invoice_items,
"invoice_text": EXAMPLE_INVOICE_TEXT,
}
parser = InvoiceParser(url="https://suf.purs.gov.rs/v/vl?")
assert parser.data() == json_value
# test with HTML content
html_value = {
"company_name": "Primer naziva firme",
"company_tin": "123456789",
"buyer_tin": "987654321",
"invoice_number": "QWERTYU1-QWERTYU1-12345",
"invoice_datetime": datetime(2024, 4, 7, 15, 0, 30).replace(tzinfo=utc),
"invoice_total_amount": 8960.0,
"invoice_items": invoice_items,
"invoice_text": """<pre style="font-family:monospace">============ ФИСКАЛНИ РАЧУН ============
123456789
OKOV INTERNATIONAL
Primer naziva firme
Кнеза Михаила
Београд-Београд
Касир: prodavac1
ИД купца: 10:987654321
ЕСИР број: 644/20.1
-------------ПРОМЕТ ПРОДАЈА-------------
Артикли
========================================
Назив Цена Кол. Укупно
Veoma dugačak naziv artikla za testiranj
e test 1 (Ђ)
4.000,00 1 4.000,00
Veoma dugačak naziv artikla za testiranj
test 2 (Ђ)
1.000,00 1 1.000,00
Kratak naziv artikla 1 (Е)
1.960,00 1 1.960,00
Kratak naziv artikla 2 (G)
1.000,00 1 1.000,00
Kratak naziv artikla 3 (A)
1.000,00 1 1.000,00
----------------------------------------
Укупан износ: 8.960,00
Платна картица: 8.960,00
========================================
Ознака Име Стопа Порез
Ђ О-ПДВ 20,00% 500,00
Е О-ПДВ 10,00% 196,00
A О-ПДВ 0,00% 0,00
G О-ПДВ 0,00% 0,00
----------------------------------------
Укупан износ пореза: 696,00
========================================
ПФР време: 07.04.2024. 17:00:30
ПФР број рачуна: QWERTY1U-QWERTY1U-18855
3
Бројач рачуна: 175097/188553ПП
========================================<br><img src="data:image/gif;base64" width="250" height="250">
======== КРАЈ ФИСКАЛНОГ РАЧУНА =========</pre>""",
}
parser = InvoiceParser(html_text=self.example_response)
assert parser.data() == html_value