Fixtures are scopes used for running tests which isolate each test from global namespace pollution and side-effects from previous tests in order to avoid false positives and false negatives
Questions tagged [fixtures]
1601 questions
0
votes
1 answer
Multiple References in Doctrine Fixtures
I have following models:
class User extends Doctrine_Record {
public function setTableDefinition() {
$this->hasColumn ( 'username', 'string', 20 );
$this->hasColumn ( 'password', 'string', 40 );
$this->hasColumn ( 'salt',…

SkaveRat
- 2,124
- 3
- 18
- 34
0
votes
2 answers
Fixture finder methods
I have two models: User, Group
I have fixtures for both of them.
I have UserTest class which is unitTest and I can use fixture finder users(:someuserfixture). However, if I try to use groups(:somegroupfixture) it says that groups isn't…

Victor Ronin
- 22,758
- 18
- 92
- 184
0
votes
1 answer
How do I populate the Django table MyApp_user_groups in a yaml fixture?
My question is very similar to How do I populate the Django table django_site in a yaml fixture? , but I need some help on this.
I create a group in auth_group table in my YAML fixture:
- model: auth.Group
pk: 1
fields:
name: admin
In my…

MobileOS
- 13
- 6
0
votes
1 answer
UserBundle Symfony 2
I tried to solve this problem myself but after three days, I give up and ask for help..
I receive "Bad credentials." erros (details: pastebin)
Here is my security.yml:
security:
encoders:
Common\UserBundle\Entity\User:
…

Gemmi
- 1,252
- 2
- 13
- 26
0
votes
1 answer
Rails Model test with minitest and fixture
I've a test in minitest:
class CompanyTest < ActiveSupport::TestCase
def setup
@company = companies(:default)
end
test 'permalink should present' do
@company.permalink = " "
assert_not @company.valid?
end
end
Fixture for…

Indyarocks
- 643
- 1
- 6
- 26
0
votes
2 answers
Symfony2 functional tests takes hours to finish using PHPUnit
I am currently creating a project using symfony2, i am using PHPUnit vendor to functional test my code.
I am facing a problem that the functional test time increases as the projects gets bigger.
Note: i am using Fixtures to be loaded for every…

Dahab
- 518
- 1
- 5
- 23
0
votes
1 answer
NoMethodError attempting to access fixture
I am working on migrating the test suite for my project to rspec. I am getting the following error trying to access my fixtures:
undefined method `[]' for nil:NilClass
Here is an example spec file:
require 'rails_helper'
feature "edit contacts"…

Fred Willmore
- 4,386
- 1
- 27
- 36
0
votes
0 answers
Use Fixture or Patch : Unit Testing
Completely new to Python unit testing. A bit of code.
class a():
def __init__(param1, param2)
self.param1 = param1
self.param2 = param2
self._problem = SomeOtherClass()
def method1(self):
self._problem.some_method()
…

amrx
- 673
- 1
- 9
- 23
0
votes
1 answer
Symfony2 Doctrine ORM ManyToMany issue
I have an M:M relation with
User<->Role<->Group.
Now I have this following relation tables in my database (additionally to users, groups, roles):
role_group,
group_role,
role_user,
user_role
Is this right? I learned that i only need 2 relation…

Mikado Joe
- 183
- 1
- 1
- 14
0
votes
2 answers
How do I make the fixtures library ignore foreign keys in SQLalchemy
I'm developing some tests for a web app with a legacy MSSQL database. The database is rather large and has many tables interconnected with foreign keys. I'm using the fixture library to create tables containing test data, based on the models I have…

Erik Oosterwaal
- 4,272
- 3
- 44
- 64
0
votes
1 answer
django model wont agree with fixture
I am trying to populate a postgresql database with initial values using fixtures in django. I keep getting these weird Could not load publication.Article(pk=None): value too long for type character varying(100)
errors even though my model looks…

samfr
- 656
- 1
- 6
- 19
0
votes
0 answers
Why "rake test" and "rake test:functionals" give different results?
I've had a weird event of having rake test and rake test:functionals producing different results on a Rails 3 app that uses fixtures to insert test database records. The first group was failing on one of the controller tests, while the other one was…

sakovias
- 1,356
- 1
- 17
- 26
0
votes
1 answer
Rails 2.3.5 table populated by fixtures at end of test run rather than at start
I start with a test database containing the schema but with no data in the tables. I run a test like so
cd test/
ruby unit/directive_test.rb
I get failures indicating that the code found no data in the data tables. However, I look at the tables…

rlandster
- 7,294
- 14
- 58
- 96
0
votes
1 answer
Rails test database values do not match fixture values
This seems like a very strange problem to me. I have a table which contained a boolean value field. I changed that field to be a string since I now want more possible values than just yes or no. I ran the migration and reran the tests. The database…

Mike F.
- 69
- 1
- 9
0
votes
1 answer
Fixtures won't hook up with Ember CLI
I'm struggling to reproduce the official Getting Started TodoMVC app with Ember CLI.
I'm stuck at Using Fixtures. Fixtures just won't load any data.
The app runs fine with no errors and no records. I open the Ember Inspector and i see that my model…

Andrey Mikhaylov - lolmaus
- 23,107
- 6
- 84
- 133