mirror of
https://github.com/django/django.git
synced 2025-07-28 15:44:20 +00:00
DEP 0003 -- Added JavaScript unit tests.
Setup QUnit, added tests, and measured test coverage. Thanks to Nick Sanford for the initial tests.
This commit is contained in:
parent
3bbaf84d65
commit
2d0dead224
19 changed files with 4716 additions and 2 deletions
22
js_tests/admin/RelatedObjectLookups.test.js
Normal file
22
js_tests/admin/RelatedObjectLookups.test.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
module('admin.RelatedObjectLookups');
|
||||
|
||||
test('html_unescape', function(assert) {
|
||||
function assert_unescape(then, expected, message) {
|
||||
assert.equal(html_unescape(then), expected, message);
|
||||
}
|
||||
assert_unescape('<', '<', 'less thans are unescaped');
|
||||
assert_unescape('>', '>', 'greater thans are unescaped');
|
||||
assert_unescape('"', '"', 'double quotes are unescaped');
|
||||
assert_unescape(''', "'", 'single quotes are unescaped');
|
||||
assert_unescape('&', '&', 'ampersands are unescaped');
|
||||
});
|
||||
|
||||
test('id_to_windowname', function(assert) {
|
||||
assert.equal(id_to_windowname('.test'), '__dot__test');
|
||||
assert.equal(id_to_windowname('misc-test'), 'misc__dash__test');
|
||||
});
|
||||
|
||||
test('windowname_to_id', function(assert) {
|
||||
assert.equal(windowname_to_id('__dot__test'), '.test');
|
||||
assert.equal(windowname_to_id('misc__dash__test'), 'misc-test');
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue