Skip to content

Commit

Permalink
Merge remote-tracking branch 'source/master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemonteith committed Sep 23, 2020
2 parents e45fec6 + 63346b0 commit 2e7b6ff
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 33 deletions.
23 changes: 10 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,23 @@ addons:
# LOL!
matrix:
include:
- python: 3.5
env: TOXENV=py35-django111-wagtail230
- python: 3.5
env: TOXENV=py35-django210-wagtail230
- python: 3.5
env: TOXENV=py35-django220-wagtail250

- python: 3.6
env: TOXENV=py36-django111-wagtail230
env: TOXENV=py36-django111-wagtail23
- python: 3.6
env: TOXENV=py36-django111-wagtail26
- python: 3.6
env: TOXENV=py36-django210-wagtail230
env: TOXENV=py36-django22-wagtail23
- python: 3.6
env: TOXENV=py36-django220-wagtail250
env: TOXENV=py36-django22-wagtail26

- python: 3.7
env: TOXENV=py37-django111-wagtail230
env: TOXENV=py37-django111-wagtail23
- python: 3.7
env: TOXENV=py37-django111-wagtail26
- python: 3.7
env: TOXENV=py37-django210-wagtail230
env: TOXENV=py37-django22-wagtail23
- python: 3.7
env: TOXENV=py37-django220-wagtail250
env: TOXENV=py37-django22-wagtail26

allow_failures:
- python: 3.6
Expand Down
8 changes: 6 additions & 2 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2.0.1
=====
- Updating to support Factory Boy 3.0

2.0.0
=====
- Removed support for Python 2.7, 3.3 and 3.4
Expand All @@ -11,10 +15,10 @@

1.0.0
=====
- Add support for Wagtail 2.0 and drop support for all wagtail versions
- Add support for Wagtail 2.0 and drop support for all wagtail versions
before 1.12

0.3.0
0.3.0
=====
- Fix import for wagtailimages.get_model()

Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Status
.. image:: https://readthedocs.org/projects/wagtail-factories/badge/?version=latest
:target: https://readthedocs.org/projects/wagtail-factories/

.. image:: https://travis-ci.org/mvantellingen/wagtail-factories.svg?branch=master
:target: https://travis-ci.org/mvantellingen/wagtail-factories
.. image:: https://travis-ci.org/wagtail/wagtail-factories.svg?branch=master
:target: https://travis-ci.org/wagtail/wagtail-factories


.. image:: https://img.shields.io/pypi/v/wagtail-factories.svg
Expand All @@ -37,7 +37,7 @@ Usage

Documentation is still in progress, but see the `tests`_ for more examples.

.. _tests: https://github.com/mvantellingen/wagtail-factories/tree/master/tests
.. _tests: https://github.com/wagtail/wagtail-factories/tree/master/tests

.. code-block:: python
Expand Down
6 changes: 3 additions & 3 deletions docs/_templates/sidebar-intro.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<h3>Links</h3>
<p>
<iframe src="http://ghbtns.com/github-btn.html?user=mvantellingen&repo=wagtail-factories&type=watch&count=true&size=large"
<iframe src="http://ghbtns.com/github-btn.html?user=wagtail&repo=wagtail-factories&type=watch&count=true&size=large"
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>
<ul>
<li><a href="http://github.com/mvantellingen/wagtail-factories">GitHub</a></li>
<li><a href="http://github.com/wagtail/wagtail-factories">GitHub</a></li>
<li><a href="http://pypi.python.org/pypi/wagtail-factories">PyPI</a></li>
<li><a href="http://github.com/mvantellingen/wagtail-factories/issues">Issue Tracker</a></li>
<li><a href="http://github.com/wagtail/wagtail-factories/issues">Issue Tracker</a></li>
</ul>
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
#
# html_theme_options = {}
html_theme_options = {
'github_user': 'mvantellingen',
'github_user': 'wagtail',
'github_banner': True,
'github_repo': 'wagtail-factories',
'travis_button': True,
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This Django app provides Factory Boy factories for the Wagtail CMS.
Documentation is still in progress, but see the `tests`_ for more examples.


.. _tests: https://github.com/mvantellingen/wagtail-factories/tree/master/tests
.. _tests: https://github.com/wagtail/wagtail-factories/tree/master/tests


Installation
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
long_description=long_description,
author="Michael van Tellingen",
author_email="[email protected]",
url='https://github.com/mvantellingen/wagtail-factories/',
url='https://github.com/wagtail/wagtail-factories/',
install_requires=install_requires,
tests_require=tests_require,
extras_require={
Expand Down
20 changes: 12 additions & 8 deletions src/wagtail_factories/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@
from django.utils.text import slugify
from factory import errors, utils
from factory.declarations import ParameteredAttribute
from wagtail import VERSION as WAGTAIL_VERSION
from wagtail.core.models import Collection, Page, Site
from wagtail.images import get_image_model

try:
from wagtail.wagtailcore.models import Collection, Page, Site
from wagtail.wagtailimages import get_image_model
from wagtail.wagtaildocs import get_document_model
from factory.django import DjangoModelFactory
except ImportError:
from wagtail.core.models import Collection, Page, Site
from wagtail.images import get_image_model
from factory import DjangoModelFactory

if WAGTAIL_VERSION >= (2, 8):
from wagtail.documents import get_document_model
else:
from wagtail.documents.models import get_document_model

__all__ = ["CollectionFactory", "ImageFactory", "PageFactory", "SiteFactory", "DocumentFactory"]
logger = logging.getLogger(__file__)
Expand Down Expand Up @@ -40,7 +44,7 @@ def generate(self, step, params):
return step.recurse(subfactory, params, force_sequence=force_sequence)


class MP_NodeFactory(factory.DjangoModelFactory):
class MP_NodeFactory(DjangoModelFactory):

parent = ParentNodeFactory()

Expand Down Expand Up @@ -116,7 +120,7 @@ class Meta:
model = Page


class CollectionMemberFactory(factory.DjangoModelFactory):
class CollectionMemberFactory(DjangoModelFactory):
collection = factory.SubFactory(CollectionFactory, parent=None)


Expand All @@ -128,7 +132,7 @@ class Meta:
file = factory.django.ImageField()


class SiteFactory(factory.DjangoModelFactory):
class SiteFactory(DjangoModelFactory):
hostname = "localhost"
port = factory.Sequence(lambda n: 81 + n)
site_name = "Test site"
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ deps =
django111: django>=1.11,<1.12
django22: django>=2.2,<2.3
wagtail23: wagtail>=2.3,<2.4
wagtail25: wagtail>=2.6,<2.7
wagtail26: wagtail>=2.6,<2.7

[testenv:coverage-report]
basepython = python3.6
Expand Down

0 comments on commit 2e7b6ff

Please sign in to comment.