Commit Graph
100 Commits
Author SHA1 Message Date
Stefan Wojcik 1fcd706e11 Clearer docstring of Document._get_collection [ci skip] 2019-06-14 14:57:12 +02:00
Stefan Wojcik 008bb19b0b Add a test covering basic Document operations
It covers operations such as:
1. Document initialization.
2. Accessing/setting attributes on a Document instance.
3. Serializing a Document instance (via `to_mongo`).
4. Deserializing a Document instance (via `_from_son`).
5. Serializing + saving a Document in the database (via `save`).
5. Loading a Document from the database + deserializing (via `Doc.objects[0]`).

And it does so for both basic flat documents and more complex nested docs.
2019-06-14 11:59:41 +02:00
Stefan Wojcik 023acab779 Clean up benchmark.py and move it to benchmarks/test_inserts.py
1. Removes the cascade=save tests. It's not an option I'd recommend using AND
   it primarily matters if you have any reference fields in your document,
   which is not the case in this script.
2. Uses PyMongo-v3.x-style write concern.
3. Removes an old docstring describing some random benchmark run from the past.
4. Removes unused parts of the code.

I'll add more tests to the "benchmarks/" directory in future commits.
2019-06-14 11:59:41 +02:00
Stefan Wojcik aa8a991d20 Try a different deployment condition
This time my attempt is based on the output found in another job that didn't
trigger a deployment: https://travis-ci.org/MongoEngine/mongoengine/jobs/544664203

```
/home/travis/.travis/job_stages: line 660: expected `)'
/home/travis/.travis/job_stages: line 660: syntax error near `AND'
/home/travis/.travis/job_stages: line 660: `  if [[ ($TRAVIS_REPO_SLUG = "MongoEngine/mongoengine") && ($TRAVIS_PYTHON_VERSION = 2.7) && ($PYMONGO = 3.x AND $MONGODB = 3.4) && ("$TRAVIS_TAG" != "") ]]; then'
```

See 80ca6360c1f3ea073e3fcb65070ded0558514ffa and
40ba51ac43 for my previous attempts.
2019-06-12 12:19:36 +02:00
Stefan Wojcik 40ba51ac43 Try a different deployment condition
The previous one was a verbatim copy-paste of what TravisCI's Support suggested
to me, but sadly it didn't work. See
https://travis-ci.org/MongoEngine/mongoengine/jobs/544655132. That build
should've triggered a deployment.

This time I'm trying a different syntax, primarily influenced by
https://docs.travis-ci.com/user/conditions-v1#boolean-operators.
2019-06-12 12:08:11 +02:00
Stefan Wojcik d20430a778 Bump up waiting for MongoDB from 15s to 20s
I've noticed that `mongo --eval 'db.version()'` has been failing fairly
regularly in the last few weeks. Hopefully that extra 5s is enough.
2019-06-12 11:57:25 +02:00
Stefan Wojcik f08f749cd9 Bump version to v0.18.0 2019-06-12 11:47:31 +02:00
Stefan Wojcik a6c04f4f9a Finalize the v0.18.0 changelog [ci skip] 2019-06-12 11:38:58 +02:00
Stefan Wojcik 15b6c1590f Add extra context to the BaseDocument.validate docstring 2019-06-12 11:37:08 +02:00
Stefan Wojcik 996618a495 Fix wording of an exception message in QuerySet.insert 2019-06-12 08:29:59 +02:00
Stefan Wojcik f131b18cbe Make test_update_shard_key_routing more resilient 2019-06-11 15:50:22 +02:00
Stefan Wojcik 118a998138 Classify the QuerySet.aggregate change as a bugfix [ci skip] 2019-06-11 15:09:16 +02:00
Stefan Wojcik 31d99c0bd2 Cleaner wording in the dev changelog 2019-06-10 11:26:47 +02:00
Stefan Wojcik 8e8c74c621 Drop the unused mongodb_version attribute in IndexesTest 2019-06-07 12:35:38 +02:00
Stefan Wojcik f996f3df74 Cleaner test_hint 2019-06-07 12:34:32 +02:00
Stefan Wojcik 9499c97e18 Clean up the .install_mongodb_on_travis.sh script
This is a leftover from #2066. Since we no longer install MongoDB versions
v2.6 – v3.2, we no longer need this code.
2019-06-07 12:16:32 +02:00
Stefan WójcikandGitHub 4334955e39 Update the test matrix to reflect what's supported in 2019 (#2066)
Previously, we were running the test suite for several combinations of MongoDB,
Python, and PyMongo:
- PyPy, MongoDB v2.6, PyMongo v3.x (which really means v3.6.1 at the moment)
- Python v2.7, MongoDB v2.6, PyMongo v3.x
- Python v3.5, MongoDB v2.6, PyMongo v3.x
- Python v3.6, MongoDB v2.6, PyMongo v3.x
- Python v2.7, MongoDB v3.0, PyMongo v3.5.0
- Python v3.6, MongoDB v3.0, PyMongo v3.5.0
- Python v3.5, MongoDB v3.2, PyMongo v3.x
- Python v3.6, MongoDB v3.2, PyMongo v3.x
- Python v3.6, MongoDB v3.4, PyMongo v3.x
- Python v3.6, MongoDB v3.6, PyMongo v3.x

There were a couple issues with this setup:
1. MongoDB v2.6 – v3.2 have reached their End of Life already (v2.6 almost 3
   years ago!). See the "MongoDB Server" section on
   https://www.mongodb.com/support-policy.
2. We were only testing two recent-ish PyMongo versions (v3.5.0 & v3.6.1).
   We were not testing the oldest actively supported MongoDB/PyMongo/Python
   setup.

This PR updates the test matrix so that these problems are solved. For the
sake of simplicity, it does not yet attempt to cover MongoDB v4.0:
- PyPy, MongoDB v3.4, PyMongo v3.x (aka v3.6.1 at the moment)
- Python v2.7, MongoDB v3.4, PyMongo v3.x
- Python v3.5, MongoDB v3.4, PyMongo v3.x
- Python v3.6, MongoDB v3.4, PyMongo v3.x
- Python v2.7, MongoDB v3.4, PyMongo v3.4
- Python v3.6, MongoDB v3.6, PyMongo v3.x
2019-05-31 11:01:15 +02:00
Stefan Wojcik dabe8c1bb7 highlight places where ValidationError is raised outside of validate() method 2018-03-14 14:26:46 -04:00
Stefan Wojcik a1494c4c93 v0.14.3 version bump 2017-10-01 17:31:10 -04:00
Stefan Wojcik d79ab5ffeb remove {nospam} from author_email & maintainer_email (PyPI doesnt validate those anymore) 2017-10-01 17:05:28 -04:00
Stefan Wojcik 01526a7b37 v0.14.1 version bump + updated changelog 2017-10-01 16:32:02 -04:00
Stefan Wojcik 091a02f737 minor .travis.yml comment correction [ci skip] 2017-10-01 16:09:10 -04:00
Stefan WójcikandGitHub 3794b181d5 Support for $position with the $push operator (#1566) 2017-07-31 15:36:35 +02:00
Stefan Wojcik a8d6e59a7a minor tweaks to code quality in _fields_to_dbfields 2017-06-18 17:25:39 -07:00
Stefan Wojcik 0bc7aa52d8 more docs tweaks [ci skip] 2017-05-08 00:14:42 -04:00
Stefan Wojcik e52603b4a7 ver bump to v0.14.0 + changelog/upgrade docs update 2017-05-08 00:12:26 -04:00
Stefan WójcikandGitHub 3b88712402 Cleaner as_pymongo (#1549) 2017-05-08 00:02:42 -04:00
Stefan Wojcik 33e9ef2106 dont test pypy3 temporarily 2017-05-07 21:37:38 -04:00
Stefan Wojcik 689fe4ed9a Revert "use a newer pypy3 (https://github.com/travis-ci/travis-ci/issues/6277)"
This reverts commit 944d1c0a4a.
2017-05-07 21:37:14 -04:00
Stefan Wojcik b82d026f39 Revert "fix tox.ini"
This reverts commit c00914bea2.
2017-05-07 21:37:05 -04:00
Stefan Wojcik 009059def4 revert #1497 2017-05-07 21:29:13 -04:00
Stefan WójcikandGitHub 03ff61d113 better db_field validation (#1547) 2017-05-07 21:11:14 -04:00
Stefan Wojcik c00914bea2 fix tox.ini 2017-05-07 20:32:52 -04:00
Stefan Wojcik 944d1c0a4a use a newer pypy3 (https://github.com/travis-ci/travis-ci/issues/6277) 2017-05-07 19:54:58 -04:00
Stefan Wojcik 2cf23e33e3 Document._get_update_doc helper method 2017-05-07 19:26:10 -04:00
Stefan Wojcik e2a0b42d03 clarify test_get_changed_fields_query_count 2017-04-30 18:29:22 -04:00
Stefan WójcikandGitHub 894e9818ac use an external sphinx rtd theme (#1541)
Externalize Sphinx RTD theme
2017-04-30 15:38:21 -04:00
Stefan WójcikandGitHub de18e256ce clean up the Document._get_collection code (#1540) 2017-04-30 14:35:33 -04:00
Stefan WójcikandGitHub 1a3c70ce1b make EmbeddedDocument not hashable by default (#1528) 2017-04-30 13:30:21 -04:00
Stefan Wojcik 824ec42005 bump version to v0.13.0 and fill in the changelog and the upgrade docs 2017-04-16 14:08:46 -04:00
Stefan WójcikandGitHub 466935e9a3 Unicode support in EmailField (#1527) 2017-04-16 13:58:58 -04:00
Stefan Wojcik b52d3e3a7b added one more item to the v0.12.0 changelog 2017-04-07 10:34:04 -04:00
Stefan Wojcik 888a6da4a5 update the changelog and bump the version to v0.12.0 2017-04-07 10:18:39 -04:00
Stefan Wojcik b78010aa94 remove test_last_field_name_like_operator (it's a dupe of the same test in tests/queryset/transform.py) 2017-03-05 21:24:46 -05:00
Stefan WójcikandGitHub 49035543b9 cleanup BaseQuerySet.__getitem__ (#1502) 2017-03-05 21:17:53 -05:00
Stefan WójcikandGitHub f9ccf635ca Respect db fields in multiple layers of embedded docs (#1501) 2017-03-05 18:20:09 -05:00
Stefan Wojcik e8ea294964 test negative indexes (closes #1119) 2017-03-05 18:12:01 -05:00
Stefan Wojcik 19ef2be88b fix #937 2017-03-05 00:05:33 -05:00
Stefan Wojcik 30e8b8186f clean up document instance tests 2017-03-02 00:25:56 -05:00
Stefan WójcikandGitHub 741643af5f clean up field unit tests (#1498) 2017-03-02 00:05:10 -05:00
Stefan WójcikandGitHub 5f43c032f2 revamp the "connecting" user guide and test more ways of connecting to a replica set (#1490) 2017-02-26 21:29:06 -05:00
Stefan Wojcik 627cf90de0 tutorial tweaks: better copy + use py3-friendly syntax 2017-02-26 20:30:37 -05:00
Stefan WójcikandGitHub e93a95d0cb Test and document controlling the size of the connection pool (#1489) 2017-02-25 14:09:10 -05:00
Stefan WójcikandGitHub 3f31666796 Fix the exception message when validating unicode URLs (#1486) 2017-02-24 16:18:34 -05:00
Stefan Wojcik 3fe8031cf3 fix EmbeddedDocumentListFieldTestCase 2017-02-22 12:44:05 -05:00
Stefan Wojcik ed34c2ca68 update the changelog and upgrade docs 2017-02-09 12:13:56 -08:00
Stefan WójcikandGitHub 3ca2e953fb Fix limit/skip/hint/batch_size chaining (#1476) 2017-02-09 12:02:46 -08:00
Stefan Wojcik f33cd625bf nicer readme 2017-01-17 02:47:45 -05:00
Stefan Wojcik 80530bb13c nicer readme 2017-01-17 02:46:37 -05:00
Stefan WójcikandGitHub affc12df4b Update README.rst 2017-01-17 02:43:29 -05:00
Stefan Wojcik 4eedf00025 nicer readme note about dependencies 2017-01-17 02:42:23 -05:00
Stefan Wojcik 1b6743ee53 add a changelog entry about broken references raising DoesNotExist 2017-01-08 14:50:16 -05:00
Stefan WójcikandGitHub ebd34427c7 Cleaner Document.save (#1458) 2016-12-30 05:43:56 -05:00
Stefan WójcikandGitHub 3d75573889 Validate db_field (#1448) 2016-12-29 12:39:05 -05:00
Stefan WójcikandGitHub c6240ca415 Test connection's write concern (#1456) 2016-12-29 12:37:38 -05:00
Stefan WójcikandGitHub 2ee8984b44 add a $rename operator (#1454) 2016-12-28 23:25:38 -05:00
Stefan Wojcik b7ec587e5b better docstring for BaseDocument.to_json 2016-12-28 22:15:46 -05:00
Stefan Wojcik 47c58bce2b fix "connect" example in the docs 2016-12-28 21:08:18 -05:00
Stefan Wojcik 96e95ac533 minor readme tweaks 2016-12-28 17:18:55 -05:00
Stefan Wojcik b013a065f7 remove readme mention of the irc channel 2016-12-28 11:50:28 -05:00
Stefan Wojcik 74b37d11cf only validate db_field if it's a string type 2016-12-28 11:46:18 -05:00
Stefan WójcikandGitHub c6cc013617 fix BaseQuerySet.fields when mixing exclusion/inclusion with complex values like $slice (#1452) 2016-12-28 11:40:57 -05:00
Stefan WójcikandGitHub f4e1d80a87 support a negative dec operator (#1450) 2016-12-28 02:04:49 -05:00
Stefan WójcikandGitHub 91dad4060f raise an error when trying to save an abstract document (#1449) 2016-12-28 00:51:47 -05:00
Stefan Wojcik e07cb82c15 validate db_field 2016-12-27 17:38:26 -05:00
Stefan Wojcik 2770cec187 better docstring for BaseQuerySet.fields 2016-12-27 10:20:13 -05:00
Stefan Wojcik 5c3928190a fix line width 2016-12-22 13:20:05 -05:00
Stefan Wojcik 96d20756ca remove redundant whitespace 2016-12-22 13:13:19 -05:00
Stefan Wojcik 553f496d84 fix tests 2016-12-13 00:42:03 -05:00
Stefan Wojcik b1d8aca46a update the changelog 2016-12-12 23:33:49 -05:00
Stefan Wojcik 8e884fd3ea make the __in=non_iterable_or_doc tests more concise 2016-12-12 23:30:38 -05:00
Stefan Wojcik 65914fb2b2 fix the way MongoDB URI w/ ?replicaset is passed 2016-12-12 23:24:19 -05:00
Stefan Wojcik a4d0da0085 update the changelog 2016-12-12 23:08:57 -05:00
Stefan WójcikandGitHub c9d496e9a0 Fix connecting to MongoReplicaSetClient (#1436) 2016-12-12 23:08:11 -05:00
Stefan Wojcik 88a951ba4f version bump 2016-12-12 19:03:21 -05:00
Stefan WójcikandGitHub 403ceb19dc set @wojcikstefan as the maintainer (closes #1342) (#1434) 2016-12-12 10:44:03 -05:00
Stefan WójcikandGitHub 835d3c3d18 Improve the health of this package (#1428) 2016-12-11 18:49:21 -05:00
Stefan Wojcik 6f5f5b4711 version bump (forgot to do it with v0.10.8 release, so have to go for v0.10.9) 2016-12-10 23:36:06 -05:00
Stefan Wojcik c6c5f85abb update the changelog with everything we've added in v0.10.8 2016-12-10 23:30:16 -05:00
Stefan WójcikandGitHub 7b860f7739 Deprecate Python v2.6 (#1430) 2016-12-10 13:29:31 -05:00
Stefan Wojcik e28804c03a add venv & venv3 to .gitignore 2016-12-10 13:11:37 -05:00
Stefan WójcikandGitHub 1b9432824b Add ability to filter the generic reference field by ObjectId and DBRef (#1425) 2016-12-09 12:56:06 -05:00
Stefan WójcikandGitHub f168682a68 Dont let the MongoDB URI override connection settings it doesnt explicitly specify (#1421) 2016-12-05 22:31:00 -05:00
Stefan WójcikandGitHub d25058a46d Implement BaseQuerySet.batch_size (#1426) 2016-12-05 22:13:22 -05:00
Stefan WójcikandGitHub 4d0c092d9f Fix iteration within iteration (#1427) 2016-12-05 09:38:24 -05:00
Stefan WójcikandGitHub 15714ef855 Fix __repr__ method of the StrictDict (#1424) 2016-12-04 16:10:59 -05:00
Stefan WójcikandGitHub eb743beaa3 fix doc.get_<field>_display + unit test inspired by #1279 (#1419) 2016-12-04 00:34:24 -05:00
Stefan WójcikandGitHub 0007535a46 Add support for cursor.comment (#1420) 2016-12-04 00:33:42 -05:00
Stefan WójcikandGitHub 8391af026c Fix filtering by embedded_doc=None (#1422) 2016-12-04 00:32:53 -05:00
Stefan WójcikandGitHub 800f656dcf remove unnecessary randomness in indexes tests (#1423) 2016-12-04 00:31:54 -05:00