Code Monkey home page Code Monkey logo

django-admin-auto-tests's Issues

setup.py broken by modern pip

pip doesnt like being used as a library.

You could use pip-api or pip-shims instead, but it is better to not rely on build dependencies. This setup.py is very complicated for rather non-complicated needs.

test_add and required form fields, usch as django-treebeard's _position

When trying to add tests to django-oscar, I am running into a problem with a model which uses https://github.com/django-treebeard/django-treebeard

First I need to map its slug field

from model_bakery import baker
from model_bakery.generators import default_mapping, SlugField

baker.generators.add('oscar.models.fields.slugfield.SlugField', default_mapping[SlugField])

Then the test_add fails

FAIL: test_add (oscar.apps.catalogue.tests.test_admin.CategoryAdminTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/admin_auto_tests/test_model.py", line 123, in test_add
    self.assertEqual(len(response.context_data['errors']), 0,
AssertionError: 1 != 0 : _position: This field is required.

The _position feel is a required ChoiceField on the form.

I see model-bakery (and mommy) doesnt mentions support for ChoiceField, so I add _position using the create_form_instance_data hook (nice!)

This is a forms field, not a db field, which might account for bakery not supporting it.
I'll also raise an issue there.

If there isnt opportunity to add support for form fields to bakery, perhaps django-admin-auto-tests should detect required form fields and mark the test as a skip or fail with a better explanation of how to implement create_form_instance_data.

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.