testing

“Duplicate key value” error when running Django tests on auth

十年热恋 提交于 2019-12-22 06:33:46
问题 I have a Django site that's working fine. It has a small amount of data in the database which I want to use for testing. I've done dumpdata to generate a few .json fixtures. But, when I try to run a test on my app ("tagger") I get a Postgresql error, and I can't work out how to solve it: (django-projectname)$ ./manage.py test tagger Creating test database for alias 'default'... Problem installing fixture '/Users/phil/Projects/RIG/projectname/django-projectname/projectname/tagger/fixtures/auth

What is the worst case for KMP string search algorithm? [closed]

谁都会走 提交于 2019-12-22 06:16:34
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . Can anyone suggest me a worst case "text string - pattern pair" for testing a KMP algorithm implementation? 回答1: I would say a pattern like xx........x | n times | and a string like xxx.........xyx...........xy..

Protractor e2e test table header and <tr>,<td> tags

谁说胖子不能爱 提交于 2019-12-22 05:53:40
问题 I am using below table. In that I want to test each tag(th, td tags), Text in that tags and count of that text. HTML snippet <table class="table table-striped"> <tbody> <tr> <th><b><a ng-href="" ng-click="predicate='id';reverse=!reverse">Patient Id</a></b></th> <th><b><a ng-href="" ng-click="predicate='accountNumber';reverse=!reverse" class="">Account Number</a></b></th> <th><b><a ng-href="" ng-click="predicate='title';reverse=!reverse">Title</a></b></th> <th><b><a ng-href="" ng-click=

Issue with Android IAP, no OrderID in Purchase Object

a 夏天 提交于 2019-12-22 05:07:01
问题 Im testing Android In app purchase subscription with one of my accounts with TEST License access (I'm aware Test access won't support Subscriptions). Noticed that there is no orderId in purchase response JSON but payment goes through(no charges though since there's a trail for 7 days on this subscription). response json looks like: "packageName": "com.xxx.xxxx", "productId": "yyyyyyyyyy_sdsda", "purchaseTime": 1426055867418, "purchaseState": 0, "purchaseToken": "xxxxxxxxxxxx", "autoRenewing":

Command line automation – expect equivalent

流过昼夜 提交于 2019-12-22 05:04:57
问题 There is a command line tool for which we need to write automated tests. Our test framework is written in C# and I was looking for .NET libraries which would let me do the automation (I know I can use the Process class; redirect the IO; do the validation, but I don't want to reinvent the wheel if possible). Ideally I'm looking for something like an expect library. Any suggestions? 回答1: I realize that this is an old question, but no one has answered. IMO, I've always had to reinvent the wheel

Are CPython, IronPython, Jython scripts compatible with each other?

纵然是瞬间 提交于 2019-12-22 05:04:10
问题 I am pretty sure that python scripts will work in all three, but I want to make sure. I have read here and there about editors that can write CPython, Jython, IronPython and I am hoping that I am looking to much into the distinction. My situation is I have 3 different api's that I want to test. Each api performs the same functionality code wise, but they are different in implementation. I am writing wrappers around each language's apis. Each wrapper should expose the exact same functionality

Web Test recorder does not allow me to record a test IE11 windows 7

我的梦境 提交于 2019-12-22 04:53:37
问题 I am trying to record a Web Performance Test using the Web Test Recorder 12.00 plugin that comes with VS 2013. This is what I get when the toolbar opens: As you can see the buttons are greyed out and disabled. I have followed this work around, but without any luck. Are there any restrictions for this tool? Is that a known issue? 回答1: I have disabled the Web Test Recorder Helper Add-on and restarted IE, and enabled Add-on again. And it worked for me. 回答2: This is a known issue. Been around for

Functional tests for flash messages after redirect

六月ゝ 毕业季﹏ 提交于 2019-12-22 04:47:39
问题 I'm not sure how to check flash messages with functional tests. My problem has something to do with redirect_to because my test for flash[:error] DOES pass. Here is what my create action looks like: def create @user = User.new(params[:user]) if @user.save redirect_to @user, flash: { success: "Welcome!" } else flash.now[:error] = "Signup failed:" render 'new' end end I have a passing test for flash[:error] that 1) checks that flash[:error] is the correct value, 2) checks the page for the flash

Injecting a mock service into a domain class for a Grails unit test?

孤者浪人 提交于 2019-12-22 04:47:33
问题 I am writing some Spock spec based unit tests under Grails 2.1.1. I'm having trouble getting springSecurityService injected into my domain object that is used by my unit. This is what I have so far, @Mock([SecUser]) @TestFor(FooService) class FooServiceSpec extends Specification { def "test some stuff"() { given: def mockSecUserService = Mock(SecUserService) mockSecUserService.emailValid(_) >> { true } mockSecUserService.checkUsername(_) >> { null } service.secUserService = mockSecUserService

How to make a PHPUnit test that depends on ~real~ POST/GET data?

瘦欲@ 提交于 2019-12-22 04:45:16
问题 I've created a PHP class that envelopes filter_input functions to make our developer's life easier. To validate an HTML form with url , name and age fields, the code would be like that: $post = Filter::POST(); if ($post->validate_string('name') && $post->validate_integer('age')) { $url = $post->sanitize_url('url'); } It would be the same as: if (filter_input(INPUT_POST,'name',FILTER_UNSAFE_RAW) && filter_input(INPUT_POST,'age',FILTER_VALIDATE_INTEGER)) { $url = filter_input(INPUT_POST,'url'