Skip to content

Commit

Permalink
Added xunit reference
Browse files Browse the repository at this point in the history
  • Loading branch information
coagulant committed Dec 23, 2011
1 parent b01232f commit cdebb7c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 11 deletions.
1 change: 1 addition & 0 deletions django_any/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = (0, 2, 1, 'dev', 0)
from django_any.forms import any_form_field, any_form
from django_any.models import any_field, any_model

9 changes: 4 additions & 5 deletions django_any/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
validate_ipv46_address = None

from django_any import xunit
from django_any.functions import valid_choices, split_model_kwargs, \
ExtensionMethod
from django_any.functions import valid_choices, split_model_kwargs, ExtensionMethod

any_field = ExtensionMethod()
any_model = ExtensionMethod(by_instance=True)
Expand All @@ -39,7 +38,7 @@ def any_field_blank(function):
def wrapper(field, **kwargs):
if kwargs.get('isnull', False):
return None

if field.blank and random.random < 0.1:
return None
return function(field, **kwargs)
Expand Down Expand Up @@ -236,7 +235,7 @@ def get_some_file(path):
result = get_some_file("%s/%s" % (path, subdir))
if result:
return result

if callable(field.upload_to):
generated_filepath = field.upload_to(None, xunit.any_string(ascii_letters, 10, 20))
upload_to = os.path.dirname(generated_filepath)
Expand Down Expand Up @@ -267,7 +266,7 @@ def get_some_file(path):

if files:
return random.choice(files)

if field.recursive:
for subdir in subdirs:
result = get_some_file(subdir)
Expand Down
3 changes: 2 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Changelog
~~~~~

* Added xunit reference
* Updated setup.py and LICENCE
* Updated setup.py to use versiontools
* Minor updates and bugfixes in docs and LICENCE

0.2.0
~~~~~
Expand Down
9 changes: 6 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../django_any'))
sys.path.insert(0, os.path.abspath('..'))
os.environ['DJANGO_SETTINGS_MODULE'] = "tests.settings"
from versiontools import format_version
import django_any

# -- General configuration -----------------------------------------------------

Expand Down Expand Up @@ -48,9 +51,9 @@
# built documents.
#
# The short X.Y version.
version = '0.2'
version = format_version(django_any.__version__, hint=django_any)
# The full version, including alpha/beta/rc tags.
release = '0.2'
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion docs/xunit.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Xunit reference
===============

.. automodule:: xunit
.. automodule:: django_any.xunit
:members:
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='django-whatever',
version='0.2.1dev',
version = ":versiontools:your_package:",
description='Unobtrusive test models creation for django.',
long_description=read(path.join(path.dirname(__file__), 'README.rst')),
author='Ilya Baryshev',
Expand All @@ -16,6 +16,9 @@
include_package_data=True,
test_suite = "tests.manage",
zip_safe=False,
setup_requires = [
'versiontools >= 1.8',
],
license='MIT License',
platforms = ['any'],
classifiers=[
Expand Down

0 comments on commit cdebb7c

Please sign in to comment.