Code Monkey home page Code Monkey logo

django-test-utils's Introduction

django-test-utils's People

Contributors

acdha avatar dnordberg avatar ericholscher avatar ernop avatar frac avatar jpic avatar millioner avatar miracle2k avatar mlissner avatar mthornhill avatar pterk avatar saltycrane avatar tmc avatar wamcvey avatar zen4ever avatar zenweasel avatar zmaillard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-test-utils's Issues

Can't run testmaker

I'll start by saying this has worked on my system in the past, and I also tried a fresh checkout of head with no difference.

When I run

./manage.py testmaker --app=[app]

I get the following partial stacktrace:

Handling app '[app]'
Logging tests to [app]\tests\cportal_testmaker.py
Traceback (most recent call last):
...
  File "C:\Python26\lib\site-packages\django_test_utils-0.3-py2.6.egg\test_utils
\management\commands\testmaker.py", line 49, in handle
    testmaker.prepare(insert_middleware=True)
  File "C:\Python26\lib\site-packages\django_test_utils-0.3-py2.6.egg\test_utils
\testmaker\__init__.py", line 43, in prepare
    self.setup_logging()
  File "C:\Python26\lib\site-packages\django_test_utils-0.3-py2.6.egg\test_utils
\testmaker\__init__.py", line 90, in setup_logging
    filename=path.devnull)
  File "C:\Python26\lib\logging\__init__.py", line 1394, in basicConfig
    hdlr = FileHandler(filename, mode)
  File "C:\Python26\lib\logging\__init__.py", line 819, in __init__
    StreamHandler.__init__(self, self._open())
  File "C:\Python26\lib\logging\__init__.py", line 838, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 2] No such file or directory: '\\\\nul'

Looking at the code the problem is passing path.devnull into logging.BasicConfig(). What I don't understand is that this seems to be a mature section of code, so why did this work on my machine before, and why isn't it working now? Also it'd be nice to have it work as intended. I simply have that commented out in my code right now.

quicktest doesn't work with South

I have a project using South for DB migrations, and have also installed django-test-utils.

However while ./manage.py test works fine, ./manage quicktest doesn't - I get an error:

  Error: Database test_livetalkback couldn't be flushed. Possible reasons:
      * The database isn't running or isn't configured correctly.
      * At least one of the expected database tables doesn't exist.
      * The SQL was invalid.
    Hint: Look at the output of 'django-admin.py sqlflush'. That's the SQL this command wasn't able to run.
    The full error: (1146, "Table 'test_livetalkback.polls_event' doesn't exist")

This is prefixed with the standard syncdb output.

From the looks of it, what's happening is that ./manage.py test is managing to get to a syncdb that is the original (django-stock) version, whereas quicktest is picking up the South modified version.

[crawler] option to disable plugins

Hi,

It would be nice to have a --disable-plugin option, to disable the time plugin for instance.

I started on a patch, but it is a little difficult at the moment, as the 'default active' plugins are setup in de the Crawler.__init__ method. I think the right solution for this is to do away with the active attribute, and populate the plugins option of the management command with the plugins that should be enabled by default. That way it is easy to disable plugins.

What do you think?

KeyError: 'SUPPORTS_TRANSACTIONS'

When I try to execute quicktest with specific app I get error:

ram@ram-laptop:~/workspace/movister/web_site$ ./manage.py quicktest movister
E
Traceback (most recent call last):
  File "/home/ram/workspace/movister/web_site/django/test/testcases.py", line 256, in __call__
    self._pre_setup()
  File "/home/ram/workspace/movister/web_site/django/test/testcases.py", line 223, in _pre_setup
    self._fixture_setup()
  File "/home/ram/workspace/movister/web_site/django/test/testcases.py", line 461, in _fixture_setup
    if not connections_support_transactions():
  File "/home/ram/workspace/movister/web_site/django/test/testcases.py", line 450, in connections_support_transactions
    for conn in connections.all())
  File "/home/ram/workspace/movister/web_site/django/test/testcases.py", line 450, in <genexpr>
    for conn in connections.all())
KeyError: 'SUPPORTS_TRANSACTIONS'

DB - Postgres 8.4

DATABASE_ENGINE = 'postgresql_psycopg2'

if installed through pip, it doesn't install twill

I install this with "pip install django-test-utils", then tried to use the twill runner. it gave an error saying twill wasn't available. "pip install twill" made the error go away. suspect a dependency is missing from django-test-utils.

minor bug in docs

in the docs we have '–addrport

This allows you to pass in the normal address and post options for runserver.'

should it not be 'port' and not 'post'

test maker creates dicts without comma separators

Here is a sample:

def test_incidentrecordincident5_130379586082(self):
r = c.post('/incident/recordincident/5/', {'customer': '''is_product': 'on''escalate_response': '24''Register': 'Record incident''source': '1''businessunit': '1''problemdescription': '2''product': '1''escalate_resolved': '36''respcentre': '1''mode': '1''csrfmiddlewaretoken': '7ff2f1bb73f90c033cc1fbf32fde0bb8''asset': ''})

I have to manually add the commas in order not to get a syntax error when I copy to my test file. Is this a bug?

devnull problem on windows systems

Hi thanks for this project. Please could you correct a little windows problem I'm having, basically /dev/null doesn't exist on windows but os.path.devnull will adapt to OS as necessary. could you change testmaker's init.py as follows:

line 89/90:
logging.basicConfig(level=logging.CRITICAL,
filename=path.devnull)

Error on installation

I got this error:

$ pip install django-test-utils                                                                                                                                                               
Collecting django-test-utils
  Using cached https://files.pythonhosted.org/packages/8f/9d/f80b0fd2bbb24c772650b31a517af70956e2a6a11f2b4cbc4058d8b2c299/django-test-utils-0.3.tar.gz
Collecting BeautifulSoup (from django-test-utils)
  Using cached https://files.pythonhosted.org/packages/1e/ee/295988deca1a5a7accd783d0dfe14524867e31abb05b6c0eeceee49c759d/BeautifulSoup-3.2.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-e0zuok91/BeautifulSoup/setup.py", line 22
        print "Unit tests have failed!"
                                      ^
    SyntaxError: Missing parentheses in call to 'print'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-e0zuok91/BeautifulSoup/

My pip freeze result is:


pip freeze
appnope==0.1.0
certifi==2017.11.5
chardet==3.0.4
cssselect==1.0.1
decorator==4.1.2
Django==1.11.3
django-autocomplete-light==3.2.10
django-ckeditor==5.3.0
django-js-asset==0.1.1
django-keeper==0.1.12
django-registration==2.2
django-tagging==0.4.6
django-taggit==0.22.1
django-widget-tweaks==1.4.1
furl==1.0.1
gunicorn==19.9.0
idna==2.6
imagestore==3.1.0
ipython==6.1.0
ipython-genutils==0.2.0
jedi==0.10.2
Khayyam==3.0.17
lxml==4.1.1
mysqlclient==1.3.12
olefile==0.44
orderedmultidict==0.7.11
pexpect==4.2.1
pickleshare==0.7.4
Pillow==4.2.1
prompt-toolkit==1.0.15
ptyprocess==0.5.2
Pygments==2.2.0
PyMySQL==0.7.11
pyquery==1.3.0
pytz==2017.2
requests==2.18.4
simplegeneric==0.8.1
six==1.10.0
sorl-thumbnail==12.4.1
swapper==1.1.0
traitlets==4.3.2
typing==3.6.4
unicode-slugify==0.1.3
Unidecode==1.0.22
urllib3==1.22
wcwidth==0.1.7

And python version is 3.4.2.
I know this error is about python version but I don't know how I can fix this. Thanks for help.

1.3 Support

Just wondering if any work has been done on this? I seems that the test runner (quicktest) doesn't work on 1.3. (problems with setup_test_environment())

I'm happy to fix it and submit a pull request, but wont if someone has already done this!

:)

crawler: ERROR / had unhandled exception: 'response'

When running ./manage.py crawlurls I get error like this:

crawler     : INFO     START: link to /projects with parameters {}
crawler     : INFO     /projects: link to / with parameters {}
crawler     : ERROR    / had unhandled exception: 'response'
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/test_utils/crawler/base.py", line 121, in run
    resp, returned_urls = self.get_url(from_url, to_url)
  File "/usr/local/lib/python2.6/dist-packages/test_utils/crawler/base.py", line 87, in get_url
    test_signals.post_request.send(self, url=to_url, response=resp)
  File "/usr/local/lib/python2.6/dist-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/local/lib/python2.6/dist-packages/test_utils/crawler/plugins/sanitize.py", line 28, in post_request
    fo.write(kwargs['response'].content)
KeyError: 'response'

makefixture seems to truncate too-long dumps

Project is basically unmaintained, but documenting for future users:

I have a pretty stock Heroku + RDS Postgres setup for a Django 1.8 webapp, with a local postgres DB setup for testing. I'm using elephantblog from feinCMS for blogging. The production blog (offerletter.io/blog/) has been getting a fair amount of posting volume, and I wanted to backfill the local development DB so I could play with styling etc of content in prod.

I ended up running heroku run --app blahblahblah makefixture elephantblog.Entry elephantblog.Category etc etc so that I could just dump all blog-related content and load it up locally in JSON. Unfortunately it looks like it's being truncated at some point. I suspect it might just be some pipe or some other random CLI UI limit, but it would be nice if it's fixed.

Error running crawlurls

$ ./manage.py crawlurls
Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
    execute_manager(settings)
  File "/Library/Python/2.5/site-packages/django/core/management/__init__.py", line 350, in execute_manager
    utility.execute()
  File "/Library/Python/2.5/site-packages/django/core/management/__init__.py", line 295, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Python/2.5/site-packages/django/core/management/__init__.py", line 249, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/Library/Python/2.5/site-packages/django/core/management/__init__.py", line 67, in load_command_class
    {}, {}, ['Command']), 'Command')()
  File "/Library/Python/2.5/site-packages/django_test_utils-0.3-py2.5.egg/test_utils/management/commands/crawlurls.py", line 6, in <module>
    from test_utils.crawler import Crawler
ImportError: cannot import name Crawler

unable to install django-test-utils library

I am getting an error while installing django-test-utils package either using "pip install django-test-utils==0.3" or simply "pip install django-test-utils".

The error is as follows:

ERROR: Command errored out with exit status 1:
command: 'c:\users\hp\django_version_update\aa1_portal_dev.venv\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-nwmmzfa1\beautifulsoup_9c63a36ebb8e4620ab876de8343c85f1\setup.py'"'"'; file='"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-nwmmzfa1\beautifulsoup_9c63a36ebb8e4620ab876de8343c85f1\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Hp\AppData\Local\Temp\pip-pip-egg-info-nj3g4utk'
cwd: C:\Users\Hp\AppData\Local\Temp\pip-install-nwmmzfa1\beautifulsoup_9c63a36ebb8e4620ab876de8343c85f1\
Complete output (6 lines):
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Hp\AppData\Local\Temp\pip-install-nwmmzfa1\beautifulsoup_9c63a36ebb8e4620ab876de8343c85f1\setup.py", line 3
"You're trying to run a very old release of Beautiful Soup under Python 3. This will not work."<>"Please use Beautiful Soup 4, available through the pip package 'beautifulsoup4'."
^
SyntaxError: invalid syntax
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/40/f2/6c9f2f3e696ee6a1fb0e4d7850617e224ed2b0b1e872110abffeca2a09d4/BeautifulSoup-3.2.2.tar.gz#sha256=a04169602bff6e3138b1259dbbf491f5a27f9499dea9a8fbafd48843f9d89970 (from https://pypi.org/simple/beautifulsoup/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached BeautifulSoup-3.2.1.tar.gz (31 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\hp\django_version_update\aa1_portal_dev.venv\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-nwmmzfa1\beautifulsoup_43f589a08acd4d9ca2147715b68dd32b\setup.py'"'"'; file='"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-nwmmzfa1\beautifulsoup_43f589a08acd4d9ca2147715b68dd32b\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Hp\AppData\Local\Temp\pip-pip-egg-info-7snaygzq'
cwd: C:\Users\Hp\AppData\Local\Temp\pip-install-nwmmzfa1\beautifulsoup_43f589a08acd4d9ca2147715b68dd32b\
Complete output (6 lines):
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Hp\AppData\Local\Temp\pip-install-nwmmzfa1\beautifulsoup_43f589a08acd4d9ca2147715b68dd32b\setup.py", line 22
print "Unit tests have failed!"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Unit tests have failed!")?
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/1e/ee/295988deca1a5a7accd783d0dfe14524867e31abb05b6c0eeceee49c759d/BeautifulSoup-3.2.1.tar.gz#sha256=6a8cb4401111e011b579c8c52a51cdab970041cc543814bbd9577a4529fe1cdb (from https://pypi.org/simple/beautifulsoup/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached BeautifulSoup-3.2.0.tar.gz (31 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\hp\django_version_update\aa1_portal_dev.venv\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-nwmmzfa1\beautifulsoup_d731155f369645a4841989d0b00c9d47\setup.py'"'"'; file='"'"'C:\Users\Hp\AppData\Local\Temp\pip-install-nwmmzfa1\beautifulsoup_d731155f369645a4841989d0b00c9d47\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Hp\AppData\Local\Temp\pip-pip-egg-info-_dl93jar'
cwd: C:\Users\Hp\AppData\Local\Temp\pip-install-nwmmzfa1\beautifulsoup_d731155f369645a4841989d0b00c9d47\
Complete output (6 lines):
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Hp\AppData\Local\Temp\pip-install-nwmmzfa1\beautifulsoup_d731155f369645a4841989d0b00c9d47\setup.py", line 22
print "Unit tests have failed!"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Unit tests have failed!")?
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/33/fe/15326560884f20d792d3ffc7fe8f639aab88647c9d46509a240d9bfbb6b1/BeautifulSoup-3.2.0.tar.gz#sha256=0dc52d07516c1665c9dd9f0a390a7a054bfb7b147a50b2866fb116b8909dfd37 (from https://pypi.org/simple/beautifulsoup/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement BeautifulSoup (from django-test-utils)
ERROR: No matching distribution found for BeautifulSoup

Here is the list of libraries in my requirements.txt file:

amqp 5.0.5
anyjson 0.3.3
asgiref 3.3.1
attrs 20.3.0
aws-encryption-sdk 2.0.0
awscli 1.19.3
Babel 2.9.0
beautifulsoup4 4.9.3
billiard 3.6.3.0
boto 2.49.0
boto3 1.17.3
botocore 1.20.3
celery 5.0.5
cffi 1.14.4
click 7.1.2
click-didyoumean 0.0.3
click-plugins 1.1.1
click-repl 0.1.6
colorama 0.4.3
cryptography 3.4.1
Django 3.1.6
django-celery 3.1.17
django-ckeditor 6.0.0
django-js-asset 1.2.2
django-jsonfield 1.4.1
django-storages-redux 1.3.3
django-tagging 0.5.0
docutils 0.15.2
flower 0.9.3
humanize 3.2.0
importlib-metadata 3.4.0
jmespath 0.10.0
kombu 5.0.2
Pillow 8.1.0
pip 21.0.1
prometheus-client 0.8.0
prompt-toolkit 3.0.14
pyasn1 0.4.8
pycparser 2.20
python-dateutil 2.8.1
pytz 2021.1
PyYAML 5.3.1
rsa 4.5
s3transfer 0.3.4
semantic-version 2.8.5
setuptools 47.1.0
setuptools-rust 0.11.6
six 1.15.0
soupsieve 2.1
sqlparse 0.4.1
toml 0.10.2
tornado 5.1.1
typing-extensions 3.7.4.3
urllib3 1.26.3
vine 5.0.0
wcwidth 0.2.5
wrapt 1.12.1
zipp 3.4.0

Kindly let me know what needs to be done here.

[makefixture] cannot create fixtures

When running e.g. manage.py makefixture auth.User
an exception is thrown:

Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.6/dist-packages/test_utils/management/commands/makefixture.py", line 126, in handle
    label_output = self.handle_label(labels, **options)
  File "/usr/local/lib/python2.6/dist-packages/test_utils/management/commands/makefixture.py", line 115, in handle_label
    return self.handle_models(parsed, **options)
  File "/usr/local/lib/python2.6/dist-packages/test_utils/management/commands/makefixture.py", line 53, in handle_models
    objects.extend(model._default_manager.filter(pk__exact=slice))
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/manager.py", line 141, in filter
    return self.get_query_set().filter(*args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 550, in filter
    return self._filter_or_exclude(False, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 568, in _filter_or_exclude
    clone.query.add_q(Q(*args, **kwargs))
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/query.py", line 1194, in add_q
    can_reuse=used_aliases, force_having=force_having)
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/query.py", line 1129, in add_filter
    connector)
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/where.py", line 67, in add
    value = obj.prepare(lookup_type, value)
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/where.py", line 316, in prepare
    return self.field.get_prep_lookup(lookup_type, value)
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/fields/__init__.py", line 292, in get_prep_lookup
    return self.get_prep_value(value)
  File "/usr/local/lib/python2.6/dist-packages/django/db/models/fields/__init__.py", line 479, in get_prep_value
    return int(value)
ValueError: invalid literal for int() with base 10: ''

I'm using django 1.3.1 and django-test-utils 0.3

Activating plugins

As far as I can tell the only way to activate any of the included plugins is:

  1. Change 'active' to True in the plugin's source
  2. Import it in the init py file

Is this correct? I propose the following:

  1. Move the active flag for plugins into a settings file that can be overridden in the project's settings. The default settings should match the currently enabled plugins.
  2. Automatically import all plugins in the directory.

This would allow projects to choose which plugins they should use. It would also allow external plugins without editing the source of django-test-utils. I don't mind submitting a PR but thought I'd run the general approach past people first.

[patch]make cookies available in testmaker(version 0.3)

--- testmaker.py 2011-09-08 13:12:48.346351096 +0800
+++ /tmp/vwI7FtA/7 2011-09-08 13:13:08.082909459 +0800
@@ -65,6 +65,8 @@
c = Client(REMOTE_ADDR='127.0.0.1')
getdict = request.GET.copy()
getdict['test_client_true'] = 'yes' #avoid recursion

  •            for key, value in request.COOKIES.items():
    
  •                c.cookies[key] = value
             response = c.get(request.path, getdict)
             self.serializer.save_response(request, response)
             self.processor.save_response(request, response)
    

Config and Docs problem

After following docs I had two problems the first was the docs said to run it as follows.
./manage.py testmaker APP
generates the following error:
Error: 'APP' is not a valid port number
So I reran it as
./manage.py testmaker 8000 APP
That starts okay, but when I view the home page I get the following error:
Traceback (most recent call last):

File "/home/paul/.virtualenvs/waypoints-env/lib/python2.5/site-packages/Django-1.0.3-py2.5.egg/django/core/servers/basehttp.py", line 279, in run
self.result = application(self.environ, self.start_response)

File "/home/paul/.virtualenvs/waypoints-env/lib/python2.5/site-packages/Django-1.0.3-py2.5.egg/django/core/servers/basehttp.py", line 651, in call
return self.application(environ, start_response)

File "/home/paul/.virtualenvs/waypoints-env/lib/python2.5/site-packages/Django-1.0.3-py2.5.egg/django/core/handlers/wsgi.py", line 230, in call
self.load_middleware()

File "/home/paul/.virtualenvs/waypoints-env/lib/python2.5/site-packages/Django-1.0.3-py2.5.egg/django/core/handlers/base.py", line 41, in load_middleware
raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e)

ImproperlyConfigured: Error importing middleware test_utils.testmaker.middleware.testmaker: "cannot import name importlib"

Status of Project?

Hi,

It looks like this project is languishing a little bit although there still seems to be interest in it. I know Eric H. is a busy guy with a lot of irons in the fire. I would be willing to help/take-over maintaining this project if there is still interest.

If there is a process for doing this, I apologize in advance for missing it.

Work on Django 1.4 support branch

Hi all,

I am trying to make django-test-utils works nicely with django 1.4. My work is available here:

https://github.com/bmihelac/django-test-utils/tree/django-1.4

Currently there is one test failing. I cannot find and now I am out of ideas, why context is not assigned to response in TestMakerMiddleware (https://github.com/bmihelac/django-test-utils/blob/django-1.4/test_utils/testmaker/middleware/testmaker.py#L68).

If I duplicate same line:

response = c.get(request.path, getdict)

second response will have contextassigned.

Any help will be appreciated.

Submit and cookies

Hello Eric,
I try using twill to my tests but I am unable to successfully submit form via POST as logged user. Look at this code:

login(username="myusername", password="mypassword")
go('/myurl/')
fv(2, 'continue', '')
submit()

problem

logout()

If I print show_cookies() I get different value before and after submit. On this test I want to check, if application return the same page with form together with error messages due to mandatory form fields. But all I get is login page (because POST don't set cookies, and my code put redirection to login page).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.