Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
berinhard committed Oct 21, 2019
2 parents fd625f7 + 0e66015 commit acd56a4
Show file tree
Hide file tree
Showing 55 changed files with 2,412 additions and 2,421 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# http://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.py]
indent_style = space
indent_size = 4

[*.{rst,ini}]
indent_style = space
indent_size = 4

[*.{yml,html,xml,xsl,json}]
indent_style = space
indent_size = 2
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Issue report
about: Create a report to help us improve
---

Short summary.

## Expected behavior

What you expected.

## Actual behavior

What happened instead.


## Reproduction Steps

How to reproduce this issue.

```python

```

### Versions

Python:
Django:
Model Mommy:
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
repos:
- repo: git@github.com:pre-commit/pre-commit-hooks
rev: v2.1.0
hooks:
- id: check-added-large-files
- id: debug-statements
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.6
hooks:
- id: flake8
30 changes: 13 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
sudo: true
language: python
dist: trusty
dist: xenial
branches:
only:
- master
- development
python:
- "2.7"
- "3.5"
- "3.6"
- "3.7"
env:
- DJANGO=django18
- DJANGO=django19
- DJANGO=django110
- DJANGO=django111
- DJANGO=django20
matrix:
exclude:
- python: "2.7"
env: DJANGO=django20
- DJANGO=django21
- DJANGO=django22
before_install:
- sudo apt-get update && sudo apt-get build-dep python-imaging
- sudo service postgresql restart
install:
- pip install tox
- pip install tox
addons:
postgresql: "9.6"
apt:
packages:
- postgresql-9.6-postgis-2.3
- postgresql-9.6-postgis-2.4
services:
- postgresql
before_script:
- psql -U postgres -c "create extension postgis"
- psql -U postgres -c "create extension hstore"
- psql -U postgres template1 -c "create extension citext"
- psql -c 'create database model_mommy;' -U postgres
- psql -c 'create database model_mommy_test;' -U postgres
- psql template1 -c "create extension hstore;"
- psql template1 -c "create extension postgis;"
- psql template1 -c "create extension citext;"
script:
- TOX_TEST_PASSENV="TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH" tox -e py${TRAVIS_PYTHON_VERSION//[.]/}-$DJANGO-{postgresql}
- TOX_TEST_PASSENV="TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH" tox -e py${TRAVIS_PYTHON_VERSION//[.]/}-$DJANGO-{sqlite}
17 changes: 12 additions & 5 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
Next
----
TODO

Development
-----------

2.0.0
-----
- Discontinue the lib and migrate to https://github.com/model-bakers/model_bakery
- Use default value for unknown field types
- Enable seq method to be imported directly from model_mommy
- Stick to Django's roadmap (https://www.djangoproject.com/download/)
- Add validation to `_fill_optional` parameter
- Add new `_from_manager` parameter to `make` method
- Clean up obsolete imports
- Save object instances when handling one to many relations

1.6.0
-----
- Support for Postgres' CI fields types
- NullBooleanField using gen_boolean generator
- Remove dependency with Django from model_mommy.random_gen module
- New paramenter `_refresh_after_create` added to `model_mommy.make` method (defaults to `False`)
- New parameter `_refresh_after_create` added to `model_mommy.make` method (defaults to `False`)

1.5.1
-----
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ help:
@cat Makefile | egrep '^(\w+?):' | sed 's/:\(.*\)//g' | sed 's/^/- /g'

test:
@python runtests.py
@python -m pytest

release:
@python setup.py sdist bdist_wheel upload
Expand Down
25 changes: 6 additions & 19 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,24 @@
Model Mommy: Smart fixtures for better tests
============================================

*Model-mommy* offers you a smart way to create fixtures for testing in Django.
With a simple and powerful API you can create many objects with a single line of code.

.. image:: https://travis-ci.org/vandersonmota/model_mommy.svg?branch=master
:target: https://travis-ci.org/vandersonmota/model_mommy
.. image:: https://travis-ci.org/berinhard/model_mommy.svg?branch=master
:target: https://travis-ci.org/berinhard/model_mommy
:alt: Test Status

.. image:: https://badge.fury.io/py/model_mommy.svg
:target: https://badge.fury.io/py/model_mommy
:alt: Latest PyPI version

.. image:: https://img.shields.io/gratipay/vandersonmota.svg?style=social&label=Donate
:target: https://www.gratipay.com/vandersonmota

Install
=======

.. code-block:: console
pip install model_mommy
Usage and Info
==============
**IMPORTANT:** Model Mommy is no longer maintained and was replaced by `Model Bakery <https://pypi.org/project/model-bakery/>`_. Please, consider `migrating your project <https://model-bakery.readthedocs.io/en/latest/migrating_from_mommy.html>`_ to use the new lib.

* http://model-mommy.readthedocs.org/
Model Mommy's creator and the maintainers decided to rename the project to not reinforce gender stereotypes for women in technology. You can read more about this subject `here <https://www.witi.com/articles/1017/How-Gender-Stereotypes-are-Still-Affecting-Women-in-Tech/>`_.


Maintainers
===========

* Ana Paula Gomes - https://github.com/anapaulagomes/
* Rustem Saiargaliev - https://github.com/amureki/
* Bernardo Fontes - https://github.com/berinhard/


Expand Down
8 changes: 5 additions & 3 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
-r requirements.txt
mock>=1.0.1
pillow
pre-commit
pytest
pytest-django
sphinx
django-test-without-migrations==0.6
tox
wheel
tox
9 changes: 9 additions & 0 deletions docs/source/basic_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ File: test_model.py ::
"""
self.rex = mommy.make('family.Dog', make_m2m=True)

Explicit M2M Relationships
--------------------------
If you want to, you can prepare your own set of related object and pass it to model_mommy. Here's an example:

File: test_models.py ::
dogs_set = mommy.prepare(models.Dog, _quantity=2)
home = mommy.make(models.Home, owner=owner, dogs=dogs_set)


Defining some attributes
------------------------

Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
# built documents.
#
# The short X.Y version.
version = '1.2.1'
version = '2.0.0'
# The full version, including alpha/beta/rc tags.
release = '1.2.1'
release = '2.0.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
10 changes: 9 additions & 1 deletion docs/source/how_mommy_behaves.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ You can override this behavior by:
kid = mommy.make(Kid, _fill_optional=True)
When shouldn't you let mommy generate things for you?
-----------------------------------------------------

Expand Down Expand Up @@ -107,6 +106,15 @@ Examples:
# in your settings.py file:
MOMMY_CUSTOM_CLASS = 'code.path.CustomMommy'
Additionaly, if you want to your created instance to be returned respecting one of your custom ModelManagers, you can use the `_from_manager` parameter as the example bellow:


.. code-block:: python
movie = mommy.make(Movie, title='Old Boys', _from_manager='availables') # This will use the Movie.availables model manager
Save method custom parameters
-----------------------------

Expand Down
70 changes: 5 additions & 65 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,75 +1,18 @@
Model Mommy: Smart fixtures for better tests
============================================

Model-mommy offers you a smart way to create fixtures for testing in Django.
With a simple and powerful API you can create many objects with a single line of code.
**IMPORTANT:** Model Mommy is no longer maintained and was replaced by `Model Bakery <https://pypi.org/project/model-bakery/>`_. Please, consider `migrating your project <https://model-bakery.readthedocs.io/en/latest/migrating_from_mommy.html>`_ to use the new lib.

Model Mommy's creator and the maintainers decided to rename the project to not reinforce gender stereotypes for women in technology. You can read more about this subject `here <https://www.witi.com/articles/1017/How-Gender-Stereotypes-are-Still-Affecting-Women-in-Tech/>`_.

Contributing to Model Mommy
===========================

As an open source project, Model Mommy welcomes contributions of many forms

Examples of contributions include:

* Code Patches
* Documentation improvements
* Bug reports


Compatibility
=============

model_mommy supports Django >= 1.8

Install
=======

Run the command above ::

pip install model_mommy

Contributing
============

1. Prepare a virtual environment.

.. code-block:: console
pip install virtualenvwrapper
mkvirtualenv model_mommy --no-site-packages --distribute
2. Install the requirements.

.. code-block:: console
pip install -r dev_requirements.txt
3. Run the tests.

.. code-block:: console
make test
Inspiration
===========

*Model-mommy* was inspired by many great open source software like ruby's ObjectDaddy and FactoryGirl.


Doubts? Loved it? Hated it? Suggestions?
========================================

Join our mailing list for support, development and ideas!

* https://groups.google.com/group/model-mommy


Contents:
Contents
--------

.. toctree::
:maxdepth: 4

install
basic_usage
how_mommy_behaves
recipes
Expand All @@ -78,9 +21,6 @@ Contents:
extensions





Indices and tables
==================

Expand Down
22 changes: 22 additions & 0 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Install Instructions
====================

Model-mommy offers you a smart way to create fixtures for testing in Django.
With a simple and powerful API you can create many objects with a single line of code.

Compatibility
=============

model_mommy supports Django >= 1.11 and Python 3

Install
=======

Run the command above ::

pip install model_mommy

Inspiration
===========

*Model-mommy* was inspired by many great open source software like ruby's ObjectDaddy and FactoryGirl.
Loading

0 comments on commit acd56a4

Please sign in to comment.