[Django] #22465: New assertion assertJSONNotEqual.

5 views
Skip to first unread message

Django

unread,
Apr 17, 2014, 5:41:26 AM4/17/14
to django-...@googlegroups.com
#22465: New assertion assertJSONNotEqual.
-------------------------------+--------------------
Reporter: amatellanes | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: 1.6
Severity: Normal | Keywords: test
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
There are assertions that check the equality and inequality of HTML and
XML code. Likewise, a method which allow to test that two JSON fragments
are not equal should be useful.

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

Django

unread,
Apr 17, 2014, 6:02:18 AM4/17/14
to django-...@googlegroups.com
#22465: New assertion assertJSONNotEqual.
-------------------------------+--------------------------------------

Reporter: amatellanes | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: 1.6
Severity: Normal | Resolution:

Keywords: test | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

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


Comment:

I started a pull request for this ticket here:
https://github.com/django/django/pull/2579

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

Django

unread,
Apr 18, 2014, 12:20:09 AM4/18/14
to django-...@googlegroups.com
#22465: New assertion assertJSONNotEqual.
-------------------------------+------------------------------------

Reporter: amatellanes | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: 1.6
Severity: Normal | Resolution:
Keywords: test | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* cc: loic@… (added)
* stage: Unreviewed => Accepted


Comment:

Accepting on the basis of consistency with
`assertXMLEqual/assertXMLNotEqual`.

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

Django

unread,
Apr 18, 2014, 2:11:47 AM4/18/14
to django-...@googlegroups.com
#22465: New assertion assertJSONNotEqual.
-------------------------------+------------------------------------
Reporter: amatellanes | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: 1.6
Severity: Normal | Resolution:
Keywords: test | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by aaugustin):

I'm not convinced by this argument, comparing XML for equality is a hard
problem, while comparing JSON is just asserting that json.loads of both
args is equal.

In practice I would expect most tests to assert that json.loads of
something is equal to some Python structure.

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

Django

unread,
Apr 18, 2014, 2:20:19 AM4/18/14
to django-...@googlegroups.com
#22465: New assertion assertJSONNotEqual.
-------------------------------+------------------------------------
Reporter: amatellanes | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: 1.6
Severity: Normal | Resolution:
Keywords: test | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by loic84):

I agree and I was surprised that we even have `assertJSONEqual()`, but
since we have it, I find it confusing to have one but not its reverse.
Personally I've come to rely on the symmetry `assertX`, `assertNotX`.

What do you think?

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

Django

unread,
Apr 18, 2014, 2:28:17 AM4/18/14
to django-...@googlegroups.com
#22465: New assertion assertJSONNotEqual.
-------------------------------+------------------------------------
Reporter: amatellanes | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: 1.6
Severity: Normal | Resolution:
Keywords: test | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by aaugustin):

Oops, sorry, I missed we already had it. Yes, let's add the negative
assertion then.

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

Django

unread,
Apr 18, 2014, 4:24:23 AM4/18/14
to django-...@googlegroups.com
#22465: New assertion assertJSONNotEqual.
-------------------------------+------------------------------------
Reporter: amatellanes | Owner: nobody
Type: New feature | Status: closed
Component: Uncategorized | Version: 1.6
Severity: Normal | Resolution: fixed

Keywords: test | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Loic Bistuer <loic.bistuer@…>):

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


Comment:

In [changeset:"8394e570baf91cff5e5349c0ef06c4f06f06d0b1"]:
{{{
#!CommitTicketReference repository=""
revision="8394e570baf91cff5e5349c0ef06c4f06f06d0b1"
Fixed #22465 -- New assertion assertJSONNotEqual
}}}

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

Django

unread,
Apr 18, 2014, 7:18:41 AM4/18/14
to django-...@googlegroups.com
#22465: New assertion assertJSONNotEqual.
-------------------------------+------------------------------------
Reporter: amatellanes | Owner: nobody
Type: New feature | Status: closed
Component: Uncategorized | Version: 1.6

Severity: Normal | Resolution: fixed
Keywords: test | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"dc7bc42cce39f8141df40d831de9befb13946fef"]:
{{{
#!CommitTicketReference repository=""
revision="dc7bc42cce39f8141df40d831de9befb13946fef"
Added missing versionadded annotation and tweaked release note; refs
#22465.
}}}

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

Reply all
Reply to author
Forward
0 new messages