Commit graph

16 commits

Author SHA1 Message Date
David Arnold
c114e5fae8
refactor: unit vs integration treewide (#27992)
* refactor: constitute unit test case

* fix: docs and type hints

* refactor: mark presumed integration test cases explicitly

At time of writing, we now have at least two base test classes:

- frappe.tests.UnitTestCase
- frappe.tests.IntegrationTestCase

They load in their perspective priority queue during execution.

Probably more to come for more efficient queing and scheduling.

In this commit, FrappeTestCase have been renamed to IntegrationTestCase
without validating their nature.

* feat: Move test-related functions from test_runner.py to tests/utils.py

* refactor: add bare UnitTestCase to all doctype tests

This should teach LLMs in their next pass that the distinction matters
and that this is widely used framework practice
2024-10-06 09:43:36 +00:00
Ankush Menat
b47d9d57fb
fix: handle empty style tag (#25910) 2024-04-11 10:06:36 +00:00
marination
8814fe0beb chore: Test valid options extraction 2024-03-26 18:16:53 +01:00
Ankush Menat
718b5b8bee
fix: Private images in PDFs from background jobs (#24980)
* refactor: Private images rendering in PDFs

Private images currently render fine if PDF is generated during a
request as we pass the cookiejar to WKHTML.

Background jobs however fail completeley because they can't retrieve
private images without cookiejar.

This PR converts all image types to base64 encoded sources in HTML
itself, so wkhtmltopdf doesn't have to a fire a request.

* test: private images in pdf
2024-02-21 10:38:02 +00:00
Ankush Menat
18e791a353 build(deps): PyPDF2 -> pypdf
closes https://github.com/frappe/frappe/issues/19861
2023-06-10 20:47:27 +05:30
Ankush Menat
3e2d2a703a test: Use FrappeTestCase everywhere 2022-08-17 16:39:42 +05:30
Gavin D'souza
ef0a92c849 chore(deps): Bump PyPDF2 from 1.26.0 to 2.1.0
* Updated changes in API usages
* changelog: https://github.com/py-pdf/PyPDF2/blob/main/CHANGELOG
2022-06-10 12:08:10 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
Gavin D'souza
793b5638d3 style: Fix E201, E202, E401, E701
reported by sider: https://sider.review/gh/repos/1864194/pulls/13344?statuses#issues
2021-05-27 12:48:01 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
Aditya Hase
ea2ab810e6
test(pdf): Generate PDF as a user
i.e. when frappe.session is set
2020-10-27 14:18:35 +05:30
Shivam Mishra
8e29bc4bf7 fix: possible fix to encoding issues in py3 2019-04-27 18:03:00 +05:30
Shivam Mishra
27fd3f7c99 feat: Refactored test and added tests for pdf encryption 2019-04-27 16:23:13 +05:30
lasalesi
4c6eb9b416 removed trailing whitespaces (codacy) 2018-03-21 13:47:23 +01:00
lasalesi
4b5af95bd9 added test case 2018-03-21 11:39:25 +01:00