Commit Graph

73 Commits

Author SHA1 Message Date
Frédéric Péters c1e826eb77 build: don't install manage.py 2020-06-12 13:10:05 +02:00
Frédéric Péters a28f0adfdb debian: add python3 packaging 2020-06-12 13:08:24 +02:00
Frédéric Péters 4a4f7025bc build: sync setup.py 2020-06-12 13:08:24 +02:00
Frédéric Péters a61f344b00 misc: remove README extraction for setup long description 2020-06-12 13:08:24 +02:00
Frédéric Péters 8e2ccd2c94 jenkins: build for all default distributions 2020-06-12 13:08:24 +02:00
Emmanuel Cazenave 4aa84aed42 run tests against python3 (#39533) 2020-02-04 18:35:08 +01:00
Emmanuel Cazenave ab07851642 cast version to string (#39533) 2020-02-04 17:29:11 +01:00
Emmanuel Cazenave 351a1a6242 adapt tests to python3 (#39533) 2020-02-04 17:28:28 +01:00
Emmanuel Cazenave 60d2884f8c use items() instead of iteritems() (#39533) 2020-02-04 17:27:47 +01:00
Emmanuel Cazenave 253fc22a15 adapt chunk read to binary data (#39533) 2020-02-04 17:27:19 +01:00
Emmanuel Cazenave 436022883a open file in binary mode (#39533) 2020-02-04 17:26:51 +01:00
Emmanuel Cazenave 5747367a56 use response.text when expecting text (#39533) 2020-02-04 17:26:18 +01:00
Emmanuel Cazenave 0ecaa0d858 grab url methods form six (#39533) 2020-02-04 17:25:01 +01:00
Emmanuel Cazenave 87c7468ab1 catch binascii.Error when decoding base64 (#39533) 2020-02-04 17:23:20 +01:00
Emmanuel Cazenave 5b788a5dff grab HTMLParser from six and adapt initialization to py3 (#39533) 2020-02-04 17:21:41 +01:00
Emmanuel Cazenave 37534c6980 use six types when calling isinstance() (#39533) 2020-02-04 17:19:16 +01:00
Emmanuel Cazenave 90bdb52e90 use python_2_unicode_compatible for objects representation (#39533) 2020-02-04 17:13:50 +01:00
Emmanuel Cazenave 090e4d2bc3 use force_text() instead of unicode() (#39533) 2020-02-04 17:09:09 +01:00
Emmanuel Cazenave 671afb17ec migration: use text instead of bytes (#39533) 2020-02-04 17:01:46 +01:00
Frédéric Péters 864bd92deb tox: limit to xmlschema < 1.1, for Python 2 compatibility 2020-01-24 09:44:34 +01:00
Michael Bideau a0ae081b74 Models: fixed url concatenation (removed '/' at the begining of the second part) 2019-12-05 21:31:40 +01:00
Michael Bideau 05a81aa993 Pylint: fixed 'keyword-arg-before-vararg' and module order issues 2019-10-29 18:26:56 +01:00
Michael Bideau 498a36bba3 Tests: fixed failing 'test_get_courrier_type' because of previous commit 2019-10-29 18:00:58 +01:00
Michael Bideau 1214526b1a Replaced courrier_type 'decision_non_opposition_DP' with 'decision_nom_opposition_sr' 2019-10-28 18:38:45 +01:00
Michael Bideau 6809c75d33 Make the connector more generic; Fixed urls and some pylint issues
Features
    * Added 'get_courrier_type' endpoint that return a 'courrier type' for a given type_dossier
    * Added url parameter 'type_dossier_detaille' to 'create_dossier' to post it in the request body
    * Replaced the way 'type fichier' is defined: now looks into 'XXX_type_raw' for file 'XXX'

Fixes
    * Url components are now encoded
    * Pylint warnings
    * Loging do not raise an error when 'files' var is empty in 'create_dossier'

Tests
    * Added 2 new errors tests to 'test_create_dossier'
    * Added 'test_get_courrier_type' to test endpoint 'get_courrier_type'
    * Fixed pylint warnings
2019-10-24 17:24:55 +02:00
Frédéric Péters 6197d8ae62 misc: fix debug log call to receive string as first parameter 2019-10-16 08:37:12 +02:00
Emmanuel Cazenave 7b5ec7f6fe jenkins: use ci@entrouvert.org for notifications 2019-10-02 14:09:52 +02:00
Michael Bideau 31ee9a8ea6 Tests: Refactoring: moving fixtures to conftest.py, added some fixture for ForwardFile and HttpRequest 2019-08-26 14:32:32 +00:00
Michael Bideau 38061d4593 Locales: added translations for 'fr' locale 2019-08-22 16:41:51 +00:00
Michael Bideau a739371cef Features: adding verbose name to all fields (mainly ForwardFile ones) 2019-08-22 16:41:28 +00:00
Michael Bideau a951f062f0 Refactoring: fix most of the (many) 'flake8' complaints 2019-08-22 16:02:06 +00:00
Michael Bideau 9df996e5ad Refactoring: fix all of the 'pylint' complaints for tests files (conftests, settings) 2019-08-22 15:13:27 +00:00
Michael Bideau 05280c153e License: prepended license text to all tests files 2019-08-22 14:51:04 +00:00
Michael Bideau afcca49f53 Refactoring: fix most of the (many many) 'pylint' complaints 2019-08-22 14:44:52 +00:00
Michael Bideau 2786bc29e7 License: prepended license text to most files 2019-08-21 15:02:33 +00:00
Michael Bideau c7e882c1e3 Resources: removed 'trac.ico' file (should not have been commited) 2019-08-21 14:51:04 +00:00
Michael Bideau 8474372bef Locales: cleaning extra 'fr' PO file (should not have been commited previously) 2019-08-21 14:39:57 +00:00
Michael Bideau 35fe3e7411 Setup.py: added locales compilation; Locales: added 'fr' PO file; Fixes: semantics and typos 2019-08-21 14:22:35 +00:00
Michael Bideau 910fc8ad57 Tests: set 'now' to a time when 'guichet' is open in 'test_openads_create_dossier' (to prevent failure when running test when 'guichet' is closed) 2019-08-21 08:54:50 +00:00
Michael Bideau 990f1fb7bc Added 'guichet' (planned availability), added CRUD views for each entity, many fixes and refactoring
Features:
    * A connector now can be associated with 'collectivites',
      and each of them can have one 'guichet'.
      A 'collectivite' have a name and an openADS technical identifier
      A 'guichet' allow to define hours and days for when its 'collectivite' is "open"
    * Each of those entities have a view to CRUD it

    * For entity ForwardFile:
       - Added association with a connector, and eventually a 'collectivite'
       - Added ForwardFiles 'size' field
       - Added updating fields 'content_type', 'file_hash' and 'size' on save()
       - Added custom validation on save()

    * For entity AtrealOpenads:
       - Added permissions on each endpoint
       - Added 'email' field support for each type of 'demandeur'
       - 'numero_dossier' is now required in the url for some endpoints (previously was a GET param)
       - Added 'upload_user_files' as an endpoint (but can still be used as a method with request=None)
       - The 'upload_user_files()' method now only handle forward file that have status='pending'

Fixes:
    * Added "*args" and "**kwargs" arguments to some connector endpoint methods
    * Added 'verbose_name' and 'ordering' on each entity META
    * Added decorator '@force_encoded_string_output' to prevent utf-8 issues with python2
    * Added __repr__, __str__ and __unicode__ functions to each entities
    * Added database indexes for each entity
    * Commented out useless JSON schema imports
    * Removed unused variable assignations

Refactoring:
    * Moved utilities functions to utils.py file
    * Added a BaseModel to provide some default functions for Models
    * Added enum/translations of hard-coded values for ForwardFile 'upload_status' field

Tests:
    * Added test for each entity
    * Added tests files specific to utilities, forms and views
    * Total code coverage is 99% with only 10 statement missed
2019-08-20 17:00:12 +00:00
Michael Bideau e8de2e66e8 JSON schemas: removed __main__ part 2019-08-20 16:23:42 +00:00
Michael Bideau 73669b0f33 JSON schemas: fixed a typo ('Un particulier' instead of 'Une personne physique') 2019-08-19 16:43:25 +00:00
Michael Bideau 4fc61d5f5e Added 'lettre_type' param to 'get_courrier()' endpoint 2019-07-29 14:35:56 +02:00
Michael Bideau d4080dae85 Added 'collectivite' param to 'create_dossier()' endpoint, removed useless '*args' and '**kwargs' 2019-07-29 14:30:50 +02:00
Michael Bideau 98cd089254 100% test coverage, dict strings are truncated when dumped, error messages homogeneized, and more
Features:
    * replaced the loging of json payload with the use of a DictDumper that lazy truncate strings too long
    * homogenize error messages

Fixes:
    * changed the signature of 'check_file_dict()' to match other functions and fix a bug
    * changed the signature of 'upload2ForwardFile()' to force input for 'type_fichier' argument

Refactoring:
    * removed dead code in 'upload_user_files()'
    * using 'basestring' instead of testing for 'str' and 'unicode'
    * renamed 'requerant' by 'demandeur'
    * removed useless and maybe problematic 'join()' (forgotten from the previous commit)
    * added more comments

Tests:
    * 100% test coverage!
    * fixed failing tests
    * added tests for every function
    * completed missing tests (mostly for exceptions)
    * added more comments
    * added the lines of missing statement in the coverage report
2019-07-25 14:29:06 +02:00
Michael Bideau 571316fcf4 JSON Schema input validation enabled (again), utf-8 decode error fixed, and more
Feature:
    * JSON Schema input validation enabled (again)

Fixes:
    * utf-8 decode error fixed: added unicode to litterals
    * removed useless and maybe problematic 'str()' forced casting
    * remove useless and maybe problematic 'join()' on list of file ids

Refactoring:
    * property 'extra_debug_enabled' removed (not used since some commits)
    * in function 'normalize()' only cast to 'unicode' if value is not already 'unicode'
2019-07-23 15:51:29 +02:00
Michael Bideau 6e709a0448 JSON Schema fixed, commented and updated with 'qualite' conditions on 'denomination' and 'raison_sociale' 2019-07-23 15:44:13 +02:00
Michael Bideau 6b4106ae25 Removed JSON schema validation, Added support for 'mandataire' and 'pouvoir_mandat', fixed bugs 2019-07-22 20:21:09 +02:00
Michael Bideau 4eddc1d502 Merge branch 'master' of ssh://git.entrouvert.org/passerelle-atreal-openads 2019-07-22 17:49:03 +02:00
Michael Bideau 719687287c Fix: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 11: ordinal not in range(128) 2019-07-22 17:41:00 +02:00