[Django] #16193: Use qunit to test javascript in django source

42 views
Skip to first unread message

Django

unread,
Jun 9, 2011, 10:23:17 AM6/9/11
to django-...@googlegroups.com
#16193: Use qunit to test javascript in django source
--------------------------------------+-----------------------------------
Reporter: mbraak@… | Owner: nobody
Type: Cleanup/optimization | Status: new
Milestone: | Component: Testing framework
Version: SVN | Severity: Normal
Keywords: testing javascript qunit | Triage Stage: Unreviewed
Has patch: 1 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------+-----------------------------------
Use qunit to test javascript in django source, especially in
contrib.admin.

I have a patch which tests some Date functions in core.js in the admin.

--
Ticket URL: <https://code.djangoproject.com/ticket/16193>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 9, 2011, 10:28:05 AM6/9/11
to django-...@googlegroups.com
#16193: Use qunit to test javascript in django source
-------------------------------------+-------------------------------------
Reporter: mbraak@… | Owner: nobody
Type: | Status: new
Cleanup/optimization | Component: Testing framework
Milestone: | Severity: Normal
Version: SVN | Keywords: testing javascript
Resolution: | qunit
Triage Stage: | Has patch: 1
Unreviewed | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 0 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by anonymous):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Code is in /tests/qunittests/

See README in this directory for instructions how to run the tests.

--
Ticket URL: <https://code.djangoproject.com/ticket/16193#comment:1>

Django

unread,
Jun 9, 2011, 10:58:38 AM6/9/11
to django-...@googlegroups.com
#16193: Use qunit to test javascript in django source
-------------------------------------+-------------------------------------
Reporter: mbraak@… | Owner: nobody
Type: | Status: new
Cleanup/optimization | Component: Testing framework
Milestone: | Severity: Normal
Version: SVN | Keywords: testing javascript
Resolution: | qunit
Triage Stage: | Has patch: 1
Unreviewed | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 0 |
UI/UX: 0 |
-------------------------------------+-------------------------------------

Comment (by anonymous):

Updated code at
https://github.com/mbraak/django/commit/21437f69672b547d542fc98a815b602e00433754

--
Ticket URL: <https://code.djangoproject.com/ticket/16193#comment:2>

Django

unread,
Jun 9, 2011, 11:26:51 AM6/9/11
to django-...@googlegroups.com
#16193: Use qunit to test javascript in django source
-------------------------------------+-------------------------------------
Reporter: mbraak@… | Owner: nobody
Type: New | Status: new
feature | Component: Testing framework
Milestone: | Severity: Normal
Version: SVN | Keywords: testing javascript
Resolution: | qunit
Triage Stage: Accepted | Has patch: 1
Needs documentation: 1 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by julien):

* needs_docs: 0 => 1
* type: Cleanup/optimization => New feature
* stage: Unreviewed => Accepted


Comment:

Note that some similar work has been done in
https://github.com/sebleier/django/tree/qunit
It'd be interesting to compare the two approaches, and also coordinate to
avoid duplicating work.

See also #16122.

--
Ticket URL: <https://code.djangoproject.com/ticket/16193#comment:3>

Django

unread,
Jun 9, 2011, 8:05:30 PM6/9/11
to django-...@googlegroups.com
#16193: Use qunit to test javascript in django source
-------------------------------------+-------------------------------------
Reporter: mbraak@… | Owner: nobody
Type: New | Status: new
feature | Component: Testing framework
Milestone: | Severity: Normal
Version: SVN | Keywords: testing javascript
Resolution: | qunit
Triage Stage: Accepted | Has patch: 1
Needs documentation: 1 | Needs tests: 0
Patch needs improvement: 1 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by jezdez):

* needs_better_patch: 0 => 1


Comment:

Well, the approach we took on Github (Sebleier's fork) is much more
generic and prepared for app centric test running.

--
Ticket URL: <https://code.djangoproject.com/ticket/16193#comment:4>

Django

unread,
Jun 9, 2011, 8:12:56 PM6/9/11
to django-...@googlegroups.com
#16193: Use qunit to test javascript in django source
-------------------------------------+-------------------------------------
Reporter: mbraak@… | Owner: nobody
Type: New | Status: new
feature | Component: Testing framework
Milestone: | Severity: Normal
Version: SVN | Keywords: testing javascript
Resolution: | qunit
Triage Stage: Accepted | Has patch: 1
Needs documentation: 1 | Needs tests: 0
Patch needs improvement: 1 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------

Comment (by julien):

Replying to [comment:4 jezdez]:

> Well, the approach we took on Github (Sebleier's fork) is much more
generic and prepared for app centric test running.

I actually played a bit with that branch a couple of weeks ago and it's
looking great. I was wondering if you guys had thought of a way to test
the admin interface (e.g. dynamically adding or removing inlines)? This
would require generating a DOM from the up-to-date admin templates and
with some test data. Perhaps we need to introduce a management command to
generate fresh HTML files from the latest admin codebase, so that these
can be tested with the admin javascript via qunit. I haven't thought of it
much beyond that, but I'll try to get to it next week.

--
Ticket URL: <https://code.djangoproject.com/ticket/16193#comment:5>

Django

unread,
Jun 10, 2011, 1:25:18 AM6/10/11
to django-...@googlegroups.com
#16193: Use qunit to test javascript in django source
-------------------------------------+-------------------------------------
Reporter: mbraak@… | Owner: nobody
Type: New | Status: new
feature | Component: Testing framework
Milestone: | Severity: Normal
Version: SVN | Keywords: testing javascript
Resolution: | qunit
Triage Stage: Accepted | Has patch: 1
Needs documentation: 1 | Needs tests: 0
Patch needs improvement: 1 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------

Comment (by mbraak):

I see that the sebleier/qunit branch is much further developed than I
initially thought. I will add my tests to this branch.

--
Ticket URL: <https://code.djangoproject.com/ticket/16193#comment:6>

Django

unread,
Aug 17, 2011, 4:50:55 AM8/17/11
to django-...@googlegroups.com
#16193: Use qunit to test javascript in django source
-------------------------------------+-------------------------------------
Reporter: mbraak@… | Owner: nobody
Type: New | Status: new
feature | Component: Testing framework
Milestone: | Severity: Normal
Version: SVN | Keywords: testing javascript
Resolution: | qunit
Triage Stage: Accepted | Has patch: 1
Needs documentation: 1 | Needs tests: 0
Patch needs improvement: 1 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------

Comment (by julien):

Some relevant discussion on django-dev: http://groups.google.com/group
/django-developers/browse_thread/thread/e0656d72e5e863d7

--
Ticket URL: <https://code.djangoproject.com/ticket/16193#comment:7>

Django

unread,
Jul 31, 2014, 7:14:05 PM7/31/14
to django-...@googlegroups.com
#16193: Use qunit to test javascript in django source
-------------------------------------+-------------------------------------
Reporter: mbraak@… | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: testing javascript | Triage Stage: Accepted
qunit | Needs documentation: 1
Has patch: 1 | Patch needs improvement: 1
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by slurms):

Figure we just want *something* to unit test the django admin javascript
as a first pass to fixing the more general problem. PR here:
https://github.com/django/django/pull/3003. Needs more tests, and still 31
jshint errors.

--
Ticket URL: <https://code.djangoproject.com/ticket/16193#comment:8>

Django

unread,
Jul 31, 2014, 7:14:27 PM7/31/14
to django-...@googlegroups.com
#16193: Use qunit to test javascript in django source
-------------------------------------+-------------------------------------
Reporter: mbraak@… | Owner: slurms
Type: New feature | Status: assigned

Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: testing javascript | Triage Stage: Accepted
qunit | Needs documentation: 1
Has patch: 1 | Patch needs improvement: 1
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by slurms):

* owner: nobody => slurms
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/16193#comment:9>

Django

unread,
Jan 26, 2015, 11:58:12 AM1/26/15
to django-...@googlegroups.com
#16193: Use qunit to test javascript in django source
-------------------------------------+-------------------------------------
Reporter: mbraak@… | Owner: slurms
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: testing javascript | Triage Stage: Accepted
qunit |
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by collinanderson):

* cc: cmawebsite@… (added)


Comment:

Do we still need this now that we have selenium tests?

--
Ticket URL: <https://code.djangoproject.com/ticket/16193#comment:10>

Django

unread,
Jul 24, 2015, 9:37:02 AM7/24/15
to django-...@googlegroups.com
#16193: Use qunit to test javascript in django source
-------------------------------------+-------------------------------------
Reporter: mbraak@… | Owner: slurms
Type: New feature | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed

Keywords: testing javascript | Triage Stage: Accepted
qunit |
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* status: assigned => closed
* resolution: => fixed


Comment:

In 2d0dead224b6448072b72b37d2fbcc8dc3afa007:

DEP 0003 -- Added JavaScript unit tests.

Setup QUnit, added tests, and measured test coverage.

Thanks to Nick Sanford for the initial tests.

--
Ticket URL: <https://code.djangoproject.com/ticket/16193#comment:11>

Reply all
Reply to author
Forward
0 new messages