testing

Django unable to load test fixtures, IntegrityError

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 03:23:33
问题 I'm using Saleor/Satchless to power and e-commerce site (inherited the project). I couldn't find a Saleor mailing list so posting here instead. I dumped the DB to create some test fixtures. ./manage.py dumpdata -e contenttypes -e sessions -e south -e > payments_data.json When I run the tests and django tries to load the fixtures it barfs this up. I'm using Postgres as the DB, and although not terribly familiar, it seems like there might be a problem with the order in which data is being

How set timeout for one test step in soapui?

半世苍凉 提交于 2019-12-22 03:21:05
问题 I have create a test step in soapui. I need to set a long delay like 5 minutes for it. I mean that there is no delay between test steps, I have to wait a response only for one step. How can I do it? 回答1: Set the Socket Timeout to 300000 milliseconds. SoapUI Documentation 回答2: TestCase Options has a Socket timeout setting for that test. You cannot set this for only one step. 回答3: As other answers says it's not possible to set the socket timeout for a TestStep , however you can do the trick

Disable GoogleAnalytics from Android App when testing or developing

笑着哭i 提交于 2019-12-22 03:07:17
问题 I'm using EasyTracker in my Android App and I need a way to disable Analytics tracking when the app is in "development" or "testing" mode (I have a flag in a constants file to discriminate). What's the best way to do so? Thanks! 回答1: You can use a class with a static boolean value let's say DEBUG like this : public final class BuildMode { public final static boolean DEBUG = true; } In code, just use : if (BuildMode.DEBUG) ... This is a solution working on all android SDK versions! 回答2: I

rubyMine 'Unable to attach test reporter to test framework'

懵懂的女人 提交于 2019-12-22 02:03:07
问题 rubyMine 'MiniTest framework was detected' error when running all model tests. I can run all model tests at the regular command line. e.g. rake spec:models When I use rubyMine: I can run one model test ok. However when I try to run all tests in model I get MiniTest framework was detected. It is a limited version of original Test::Unit framework. RubyMine/IDEA Ruby plugin test runner requires full-featured version of the framework, otherwise default console tests reporter will be used instead.

How to disable south debug logging in django?

亡梦爱人 提交于 2019-12-22 02:02:30
问题 When I run my tests in Django, after a fail I got several pages of debug output from South, like these: south: DEBUG: south execute "CREATE INDEX "sometable_4d5bad5" ON "video_playable" ("network_id");" with params "[]" south: DEBUG: south execute "CREATE INDEX "sometable_790e6d98" ON "video_playable" ("published");" with params "[]" south: DEBUG: south execute "CREATE INDEX "sometable_72312277" ON "video_playable" ("archived");" with params "[]" And with all this logging output, the relevant

Skip one test in test file Jest

霸气de小男生 提交于 2019-12-22 01:53:26
问题 I'm using Jest framework and have a test suite. I want to turn off/skip one of my tests. Googling documentation doesn't give me answers. Do you know the answer or source of information to check? 回答1: I found the answer here https://devhints.io/jest test('it is raining', () => { expect(inchesOfRain()).toBeGreaterThan(0); }); test.skip('it is not snowing', () => { expect(inchesOfSnow()).toBe(0); }); Link on off doc 回答2: You can also exclude test or describe by prefixing them with an x .

Is it possible to send a reason for Jasmine 2 specs skipped with xit or pending()?

大兔子大兔子 提交于 2019-12-22 01:41:02
问题 When we find a bug with one of our Protractor Jasmine2 specs, we usually want to skip the test until the bug has been resolved. I know how to do this with xit or pending() , and JasmineReporters TerminalReporter is doing a nice job of color highlighting and listing pending specs. However, the pending tests always report No reason given , which implies it is possible to give a reason for the skipped test. I currently comment the spec with an issue number, but it would be really nice to report

How can I mock JodaTime actual date?

末鹿安然 提交于 2019-12-22 01:33:28
问题 I want to test this method: public FirmOrder findActiveByModelColor(ModelColor modelColor) { Query query = em.createQuery("FROM FirmOrder fo WHERE fo.modelColor = :modelColor AND fo.year = :year AND fo.month = :month"); query.setParameter("modelColor", modelColor); query.setParameter("year", new DateTime().year().get()); query.setParameter("month", new DateTime().monthOfYear().get()); return (FirmOrder) query.getSingleResult(); } but I need DateTime().year().get() and DateTime().dayOfMonth()

Tcl/Tk - automating GUI testing

☆樱花仙子☆ 提交于 2019-12-22 01:30:55
问题 I want to automate the testing of my GUI. I went through the following post but if someone can post a sample test code for the following example it would be much easier for me to understand. The following is my simple Hello World code. namespace eval Gui { } proc Gui::hello {} { toplevel .hello wm title .hello "Hello" wm resizable .hello 0 0 ;# not resizable # create a frame to hold the check widgets set f [frame .hello.boolean -borderwidth 10] pack $f -side top # OK and Cancel buttons button

How to modify protractor html screenshot reporter to show report for each “expect” (assertion ) instead of each “it” block in spec file

坚强是说给别人听的谎言 提交于 2019-12-22 01:29:40
问题 I have 3 'it' specs with 27 expects in the code. protractor-html-screenshot-reporter includes 'it' specs but not expect level results. Please let me know, can i make any configuration changes to make it work. Thanks, Arpit Jain 回答1: protractor-html-screenshot-reporter works on the spec-level ( it blocks). According to the source code, it defines the reportSpecResults function which is called by jasmine when the reporting results for a spec run. 回答2: The below code takes a screenshot on each