大约有 15,500 项符合查询结果(耗时:0.0229秒) [XML]
Disable migrations when running unit tests in Django 1.7
...
like syncdb did in 1.6. I defined a new settings module just for unit
tests called "settings_test.py", which imports * from the main
settings module and adds this line:
MIGRATION_MODULES = {"myapp": "myapp.migrations_not_used_in_tests"}
Then I run tests like this:
DJANGO_SETTIN...
AttributeError: 'module' object has no attribute 'tests'
...finally figured it out working on another problem. The problem was that my test couldn't find an import.
It looks like you get the above error if your test fails to import. This makes sense because the test suite can't import a broken test. At least I think this is what is going on because I fixed...
Rspec, Rails: how to test private methods of controllers?
...l private methods with send, but that doesn't necessarily mean you should. Testing private methods is done through testing the public interface to those methods. This approach will work, but it's not ideal. It'd be better if the method was in a module that was included into the controller. Then it ...
How to test chrome extensions?
...sing localstorage. Are there any tools, frameworks, etc. that I can use to test this behavior? I realize there are some generic tools for testing javascript, but are those sufficiently power to test an extension? Unit testing is most important, but I'm also interested in other types of testing (such...
Can a unit test project load the target application's app.config file?
I am unit testing a .NET application (.exe) that uses an app.config file to load configuration properties. The unit test application itself does not have an app.config file.
...
Get name of currently executing test in JUnit 4
In JUnit 3, I could get the name of the currently running test like this:
14 Answers
1...
How to output in CLI during execution of PHP Unit tests?
When running a PHPUnit test, I would like to be able to dump output so I can debug one or two things.
17 Answers
...
Unit Testing bash scripts
...at has some bash scripts running besides Java code. Since we are trying to Test Everything That Could Possibly Break, and those bash scripts may break, we want to test them.
...
Select datatype of the field in postgres
... data_type
end as myType
from information_schema.columns
where table_name='test'
with result:
column_name | myType
-------------+-------------------
test_id | test_domain
test_vc | varchar(15)
test_n | numeric(15,3)
big_n | bigint
ip_addr | inet
...
What's the difference between a mock & stub?
I've read various articles about mocking vs stubbing in testing, including Martin Fowler's Mocks Aren't Stubs , but still don't understand the difference.
...