Skip to content

Commit

Permalink
cleaning up tests and setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sorl committed Feb 6, 2011
1 parent 52db5de commit 9fb5600
Show file tree
Hide file tree
Showing 32 changed files with 76 additions and 425 deletions.
File renamed without changes.
54 changes: 0 additions & 54 deletions CHANGES.rst

This file was deleted.

4 changes: 2 additions & 2 deletions LICENSE.txt → LICENSE
@@ -1,4 +1,4 @@
DJANGO MOCKUPS
django-mockups
==============
Copyright (c) 2010, Mikko Hellsing
All rights reserved.
Expand Down Expand Up @@ -27,7 +27,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


DJANGO AUTOFIXTURE
django-autofixture
==================
Copyright (c) 2010, Gregor Müllegger
All rights reserved.
Expand Down
8 changes: 3 additions & 5 deletions MANIFEST.in
@@ -1,5 +1,3 @@
include AUTHORS.txt
include CHANGES.rst
include LICENSE.txt
include MANIFEST.in
include README.rst
include AUTHORS LICENSE README.rst
recursive-include docs *
recursive-include mockups/tests/media *
9 changes: 1 addition & 8 deletions README.rst
@@ -1,7 +1,6 @@
==============
django-mockups
==============

This app aims to provide a simple way of loading masses of randomly generated
test data into your development database. You can use a management command to
load test data through command line.
Expand All @@ -18,11 +17,9 @@ actually be spent on hacking.

Installation
============

You must make the ``mockups`` package available on your python path. Either
drop it into your project directory or install it from the python package index
with ``pip install django-mockups``. You can also use ``easy_install
django-mockups`` if you don't have pip available.
with ``pip install django-mockups``.

To use the management command you must add ``'mockups'`` to the
``INSTALLED_APPS`` setting in your django settings file. You don't need to do
Expand All @@ -31,7 +28,6 @@ this if you want to use the ``mockups`` package only as library.

Management command
==================

The ``mockups`` accepts the following syntax::

django-admin.py mockups [options] app.Model:# [app.Model:# ...]
Expand Down Expand Up @@ -60,7 +56,6 @@ information::

Using mockups as tool for unittests
========================================

It has proofed that mockups have a great use for unittests. It has always
bugged me that creating complex models for testing their behaviour was
complicated. Sometimes models have strict restrictions or many related objects
Expand Down Expand Up @@ -102,7 +97,6 @@ All created entry models get one to three new categories assigned.

Setting custom values for fields
--------------------------------

However its often necessary to be sure that a specific field must have a
specific value. This is easily achieved with the use of ``Factory``::

Expand All @@ -117,7 +111,6 @@ specific value. This is easily achieved with the use of ``Factory``::

More
====

There is so much more to explore which might be useful for you and your
projects:

Expand Down
121 changes: 0 additions & 121 deletions bootstrap.py

This file was deleted.

51 changes: 0 additions & 51 deletions fabfile.py

This file was deleted.

9 changes: 0 additions & 9 deletions manage.py

This file was deleted.

2 changes: 2 additions & 0 deletions mockups/base.py
Expand Up @@ -8,9 +8,11 @@
class IGNORE_FIELD(object):
pass


class CreateInstanceError(Exception):
pass


class Link(object):
'''
Handles logic of following or generating foreignkeys and m2m relations.
Expand Down
5 changes: 4 additions & 1 deletion mockups/generators.py
Expand Up @@ -165,12 +165,15 @@ def generate(self):
lorem = lorem[:max(1, length)]
return lorem.strip()


class LoremSentenceGenerator(LoremGenerator):
method = 's'


class LoremHTMLGenerator(LoremGenerator):
method = 'p'


class LoremWordGenerator(LoremGenerator):
count = 7
method = 'w'
Expand Down Expand Up @@ -417,6 +420,7 @@ def generate(self):
filename = relpath(filename, settings.MEDIA_ROOT)
return filename


# TODO: try to get this thing out of here
class InstanceGenerator(Generator):
'''
Expand Down Expand Up @@ -607,4 +611,3 @@ def get_generator(self, field, **kwargs):
return IntegerGenerator(min_value=-field.MAX_BIGINT - 1,
max_value=field.MAX_BIGINT)


File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -6,11 +6,10 @@
from mockups import generators
from mockups import Factory
from mockups.base import ModelMockup, CreateInstanceError, Link
from mockups_tests.mockups_test.models import y2k
from mockups_tests.mockups_test.models import (
SimpleModel, OtherSimpleModel, DeepLinkModel1, DeepLinkModel2,
NullableFKModel, BasicModel, UniqueTestModel, UniqueTogetherTestModel,
RelatedModel, O2OModel, M2MModel, ThroughModel, M2MModelThrough)
from mockups_test.models import (y2k, SimpleModel, OtherSimpleModel,
DeepLinkModel1, DeepLinkModel2, NullableFKModel, BasicModel,
UniqueTestModel, UniqueTogetherTestModel, RelatedModel, O2OModel,
M2MModel, ThroughModel, M2MModelThrough)


class SimpleFactory(Factory):
Expand Down
File renamed without changes.

0 comments on commit 9fb5600

Please sign in to comment.