Giter Club home page Giter Club logo

django-protractor's People

Contributors

dbaxa avatar dmikhaylov avatar jpulec avatar juliomenendez avatar penguin359 avatar ryangallen avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

django-protractor's Issues

TypeError: 'str' does not support the buffer interface

Currently getting a traceback when test runs via python manage.py protractor:

Starting webdriver...
Creating test database for alias 'default'...
Starting server...
Process Process-1:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/multiprocessing/process.py", line 254, in _bootstrap
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/me/.virtualenvs/sdj/lib/python3.4/site-packages/protractor/management/commands/protractor.py", line 111, in runserver
    stdout=open(os.devnull, 'wb')
  File "/Users/me/.virtualenvs/sdj/lib/python3.4/site-packages/django/core/management/__init__.py", line 120, in call_command
    return command.execute(*args, **defaults)
  File "/Users/me/.virtualenvs/sdj/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 49, in execute
    super(Command, self).execute(*args, **options)
  File "/Users/me/.virtualenvs/sdj/lib/python3.4/site-packages/django/core/management/base.py", line 441, in execute
    output = self.handle(*args, **options)
  File "/Users/me/.virtualenvs/sdj/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 88, in handle
    self.run(**options)
  File "/Users/me/.virtualenvs/sdj/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 99, in run
    self.inner_run(None, **options)
  File "/Users/me/.virtualenvs/sdj/lib/python3.4/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
    self.stdout.write("Performing system checks...\n\n")
  File "/Users/me/.virtualenvs/sdj/lib/python3.4/site-packages/django/core/management/base.py", line 114, in write
    self._out.write(force_str(style_func(msg)))
TypeError: 'str' does not support the buffer interface
Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver
........

Finished in 23.377 seconds
8 tests, 11 assertions, 0 failures

Protractor still hitting the production DB

Running python manage.py protractor seems to work the first time.

It runs the tests and displays the following messages.

Starting webdriver...
Creating test database for alias 'default'...
.....etc
Destroying test database for alias 'default'...
Success

But it always fails the second time around, after poking around I noticed that the tests were actually being ran against the prod DB instead of test, hence the reason for the failing tests.

Not sure if this is a bug or if I configured it wrong?

In django >1.10 BaseCommand.option_list is deprecated

Description

The parser fails because BaseCommand has no longer such attribute as option_list
It's self explanatory but here is the exact traceback:

Traceback (most recent call last):
File "manage.py", line 22, in
execute_from_command_line(sys.argv)
File "/home/antoni/.virtualenvs/djangotractor/local/lib/python2.7/site-packages/django/core/management/init.py", line 363, in execute_from_command_line
utility.execute()
File "/home/antoni/.virtualenvs/djangotractor/local/lib/python2.7/site-packages/django/core/management/init.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/antoni/.virtualenvs/djangotractor/local/lib/python2.7/site-packages/django/core/management/init.py", line 205, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/home/antoni/.virtualenvs/djangotractor/local/lib/python2.7/site-packages/django/core/management/init.py", line 40, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/antoni/.virtualenvs/djangotractor/local/lib/python2.7/site-packages/protractor/management/commands/protractor.py", line 16, in
class Command(BaseCommand):
File "/home/antoni/.virtualenvs/djangotractor/local/lib/python2.7/site-packages/protractor/management/commands/protractor.py", line 20, in Command
option_list = BaseCommand.option_list + (
AttributeError: type object 'BaseCommand' has no attribute 'option_list'

Proposed solution

Change
option_list = BaseCommand.option_list + ...

to


    def add_arguments(self, parser):
        parser.add_argument('--protractor-conf',
            action='store',
            dest='protractor_conf',
            default='protractor.conf.js',
            help='Specify a destination for your protractor configuration'
        )
...

It looks like it does the trick

Fixture Loading/Initial Data

Currently there is no way to load fixtures or setup initial data via factories. Would be a nice feature to add.

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.