Commit graph

34 commits

Author SHA1 Message Date
Aarol D'Souza
799123c341
perf(postgres): skip unnecessary migrations due to type mismatch (#34784) 2025-12-29 18:29:22 +05:30
Aarol D'Souza
5fecde5a6a
test(postgres): enable test_unique_index_on_alter for postgres (#34719)
* test(postgres): enable test_unique_index_on_alter for postgres

* perf(postgres): Prevent redundant unique index creation on new columns
2025-11-24 11:05:20 +05:30
AarDG10
1ffbe4eaad test(postgres): add pg-compatible query for unique index check 2025-11-07 17:19:35 +05:30
AarDG10
907f3de872 test(postgres): enable test_varchar_length for postgres 2025-11-07 12:37:55 +05:30
sokumon
6f9c7f3241 fix: add a correct test 2025-10-01 17:43:39 +05:30
sokumon
3cb061bacb fix: add reference and test_case 2025-09-04 12:54:35 +05:30
Ankush Menat
a6b716acaa
test: reduce sanity test time (#33277)
Takes too long. Unlikely to break soon as this code is hardly modified.
2025-07-10 13:16:58 +00:00
Ankush Menat
1a1dc0a62c
fix: more bad migrations and sanity test (#33112)
* test: prevent unnecessary migrations

* fix: Avoid resyncing JSON repeatedly

* fix: Varchar not nullable defaults should be casted

* fix: force cast to float before

Bad default values cause it to break.
2025-06-26 10:31:55 +00:00
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
fb27368a53
feat: Link fields with UUID datatype in DB (#26625)
Link fields that refer to doctypes with UUID naming will also be UUID.
2024-05-31 09:17:09 +00:00
Ankush Menat
eef9c2c8cc refactor!: Better Integer handling
- Remove length: it makes no difference, it's for ZEROFILL only.
- Switch to tinyint for checkboxes in mysql and smallint on postgres.
- Use `int` instead of `bigint` by default.
2024-04-06 11:11:29 +05:30
Ankush Menat
30f00fd5f3 fix: invlaid integer validations for biging
closes https://github.com/frappe/frappe/issues/25566
2024-04-06 11:04:55 +05:30
Ankush Menat
8c6e3a56c6 feat: UUID name implementation for postgres 2024-03-29 21:02:54 +05:30
Ankush Menat
8cc6c31f0e fix: Allow switching between UUID and VARCHAR
- VARCHAR -> UUID = Only allowed when table is empty for now
- UUID -> VARCHAR is not lossy, can be done anytime.
2024-03-29 19:02:28 +05:30
barredterra
b553ed98d8 refactor: inline immediately returned variable
Inline a variable to a return in the case when the
variable being declared is immediately returned
2023-08-08 18:09:49 +02:00
Ankush Menat
9b2283092e test: another test case for index duplication 2022-12-15 14:11:26 +05:30
Ankush Menat
e437d0aca2 test: test index after col change too 2022-12-15 13:39:25 +05:30
Ankush Menat
8df845ca35 fix: duplicate unique index when column is altered 2022-12-15 13:36:28 +05:30
Ankush Menat
d27ea5e6da test: unique index on install and alter
There should always be 1 unique index.
2022-12-15 13:36:28 +05:30
phot0n
82d0faf3d2 test: use middle_name instead of restrict_ip in test_index_and_unique_constraints 2022-09-19 18:38:47 +05:30
Ankush Menat
3e2d2a703a test: Use FrappeTestCase everywhere 2022-08-17 16:39:42 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +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
phot0n
266e1f95ed chore: adding back idx column
This is needed for ordering in display of links as it keeps
track of the clicks on a particular link item
2022-02-07 16:40:01 +05:30
phot0n
b31f3c24f6 refactor: remove parent, parenttype, parentfield, idx columns from non-child table doctypes
* feat: add parent, parenttype, idx, parentfield columns to doctypes when transitioning from normal -> child table

* fix: remove parent, parenttype, parentfield, idx from DocType DocType
2022-02-07 15:12:37 +05:30
Ankush Menat
e5eca8232f
fix: dont auto drop manually created index on text types (#15739) 2022-01-26 17:47:30 +05:30
Suraj Shetty
72af9c7366 test: Fix test_index_and_unique_constraints 2022-01-23 22:59:13 +05:30
Suraj Shetty
b3f9e8e2cf test: Add cases to validate index and unique constraints 2022-01-21 21:20:47 +05:30
Rushabh Mehta
8a198f363b fix(default): cast as string as required 2020-10-26 10:02:04 +05:30
Shivam Mishra
7696f11e3c feat: update test to check DATA to Text change 2020-04-15 13:24:01 +05:30
Suraj Shetty
bf69b98cba test: Set docstatus type as Check 2020-03-21 18:24:15 +05:30
Suraj Shetty
641580a300 test: Add a fallback default 2020-03-21 18:11:42 +05:30
Suraj Shetty
8f8e361766 style: Fix formatting issues 2020-03-21 17:45:39 +05:30
Suraj Shetty
739f061871 test: Add test for frappe.db.updatedb 2020-03-21 12:30:54 +05:30