# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import unittest
from frappe.utils.pdf import read_options_from_html
#class TestPdfBorders(unittest.TestCase):
class TestPdfBorders(unittest.TestCase):
def test_pdf_borders(self):
html = """
This is a test html snippet
"""
html, html_options = read_options_from_html(html)
self.assertTrue(html_options['margin-top'] == '0')
self.assertTrue(html_options['margin-left'] == '10')
self.assertTrue(html_options['margin-right'] == '0')
# allows to run $ bench execute frappe.tests.test_pdf.run_tests
def run_tests():
t = TestPdfBorders("test_pdf_borders")
t.test_pdf_borders()
return