Roberto Rosario
b6e0de01f3
Make random PK mixin work with pre_save signals
...
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com >
2019-04-02 13:38:21 -04:00
Roberto Rosario
50d4aa0e22
Allow disabling test's expected_content_type
...
Setting expected_content_type to None will now disable
the reponse HTTP content type checking. Added
to allow API tests to be a subclass of the test view test
case and support all the mixins without having to declare
them separately.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2019-03-15 02:56:34 -04:00
Roberto Rosario
2a1e060907
TestModelMixin: Perform stateless model creation
...
Don't delete test models at the end of the test case.
Failed test cases don't execute the tearDown() method.
Instead perform model registry cleanup before creating
any new test model.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2019-03-04 16:18:39 -04:00
Roberto Rosario
711a28dccf
Test models: Clear ContentType cache
...
Clear the ContentType cache when adding or removing
test models.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2019-03-03 20:01:50 -04:00
Roberto Rosario
442faca915
Update test models to generate random PK
...
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2019-03-02 17:32:38 -04:00
Roberto Rosario
2a67cf271e
Refactor ACL app API
...
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2019-03-02 16:03:29 -04:00
Roberto Rosario
48aad4f356
Add mixin to provide temporary test models
...
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2019-03-02 01:49:30 -04:00
Roberto Rosario
23d56c3147
Improve ClientMethodsTestCaseMixin
...
Reduce repeated code.
Add support for passing query string dictionary to
the test client.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2019-02-23 05:04:28 -04:00
Roberto Rosario
8e66eefe7c
Move file and storage code to the storage app
...
The setting COMMON_TEMPORARY_DIRECTORY is now
STORAGE_TEMPORARY_DIRECTORY.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2019-01-31 22:30:51 -04:00
Roberto Rosario
b4a81ee0bc
Random ID test mixin: Restore save method
...
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2019-01-30 03:29:12 -04:00
Roberto Rosario
c5d4054fb6
Add test mixin to generate random primary keys
...
Add a new mixin to monkey patch the Model class to
force each newly created model instance to use a randomly
generated primary key.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2019-01-25 01:22:57 -04:00
Roberto Rosario
65ccbd3b7b
Reorganize reusable test code
...
Extract test views and user code into their own separate test case
mixins. Append TestCase to test case mixins with base test code
to differentiate them from test mixins with reusable view calls.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2019-01-03 14:49:48 -04:00
Roberto Rosario
8e0a2bbdbc
Move the base test ACL mixin to the ACLs app
...
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2019-01-02 02:44:50 -04:00
Roberto Rosario
23a4a56aae
Fix failing tests
...
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2018-12-29 04:47:40 -04:00
Roberto Rosario
3adb9d4ea0
Sort method arguments
...
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2018-12-14 18:08:44 -04:00
Roberto Rosario
0c7f9f50af
Tests: Mute database convertion tests output
...
Mute the root mixin to mute all the database conversion tests.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2018-12-07 21:16:07 -04:00
Roberto Rosario
55a30379bd
Various apps: Sort imports
...
Run imports as per Mayan EDMS best practices.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com >
2018-12-06 01:57:24 -04:00
Roberto Rosario
8e69178e07
Project: Switch to full app paths
...
Instead of inserting the path of the apps into the Python app,
the apps are now referenced by their full import path.
This app name claves with external or native Python libraries.
Example: Mayan statistics app vs. Python new statistics library.
Every app reference is now prepended with 'mayan.apps'.
Existing config.yml files need to be updated manually.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com >
2018-12-05 02:04:20 -04:00
Roberto Rosario
a99b044555
Code style improvement. Test code consolidation. PEP8 cleanups.
...
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com >
2018-10-06 02:13:36 -04:00
Roberto Rosario
9716e51914
Force load of serialized data when running as a test.
...
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com >
2018-09-21 00:26:24 -04:00
Roberto Rosario
5d24521049
Add test mixin to test the db conversion (dumping and loading) of a specific app.
...
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com >
2018-09-21 00:11:17 -04:00
Roberto Rosario
275229cd52
Fix failing tests.
...
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com >
2017-08-27 19:48:30 -04:00
Roberto Rosario
5798cabd7c
Add support to update the document indexes from workflow state changes.
...
Add a new workflow field called internal_name for easier workflow
reference in document index templates.
Generalize the PropertyHelper class.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com >
2017-06-06 20:07:15 -04:00
Roberto Rosario
106816ab7f
Do not impot psutils for test if it is not going to be used.
...
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com >
2017-03-15 00:16:44 -04:00
Roberto Rosario
63682a2945
Merge remote-tracking branch 'origin/master' into feature/master_merge
...
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com >
2017-03-14 15:57:38 -04:00
Roberto Rosario
01c2e262eb
Ignore LibreOffice fontconfig cache dir when testing for orphan
...
temporary files.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com >
2017-02-23 20:06:55 -04:00
Roberto Rosario
e090628d72
Make testing for orphaned file handles and temporary files optional.
...
Allows for running tests in parallel.
2017-02-17 18:50:36 -04:00
Roberto Rosario
914c5e7146
Code cleanups.
2017-01-28 22:56:52 -04:00
Roberto Rosario
877772f80d
Add another temporary directory to be ignored during tests.
2016-11-03 15:49:28 -04:00
Roberto Rosario
6e3d99670c
Complete conversion of download views to CBV views using django-downloadview.
...
This also removes dependency on the filetransfers library.
2016-10-31 01:00:35 -04:00
Roberto Rosario
d488c8271b
Merge branch 'development'
2016-10-26 04:46:36 -04:00
Roberto Rosario
7b9a2bcfcc
Ignore GitLab's CI .config temporary file.
2016-10-26 04:26:22 -04:00
Roberto Rosario
72980f09a6
Update TempfileCheckMixin to show list of oprhaned files.
2016-10-26 04:05:32 -04:00
Roberto Rosario
0b5edb4ad6
Add support to ignore certain temporary file patterns to the TempfileCheckMixin
2016-10-26 02:16:44 -04:00
Roberto Rosario
1f1954161e
Merge branch 'development'
2016-10-25 02:50:50 -04:00
Roberto Rosario
a44c76165b
Add test view mixin to check for responses content types. Relates to GitLab issue #311 .
2016-10-21 03:41:15 -04:00
Roberto Rosario
4b7c4335e1
Improve TempfileCheckMixin.
2016-06-30 16:02:17 -04:00
Roberto Rosario
97089670ee
Change the file descriptor check to use open files instead. Add decorator to skip open file check. GitLab issue #309 .
2016-06-29 18:40:15 -04:00
Roberto Rosario
2ea3c08c97
Add _future_ import to force unicode.
2016-06-28 03:01:04 -04:00
Roberto Rosario
113ad144e0
Add test mixins for file descriptor leaks and unclaimed temporary files. GitLab issue #309 .
2016-06-27 19:19:37 -04:00