fixtures

Rails fixtures get table names wrong

耗尽温柔 提交于 2019-12-08 03:27:58
问题 I have a roles table, a permissions table, and to join them in a many-to-many relationship a roles_permissions table. In the roles.yml file I have this: admin: name: admin permissions: create_user, edit_user, view_all_users In the permissions.yml I have: create_user: name: create_user description: Create a new user edit_user: name: edit_user description: Edit any user details view_all_users: name: view_all_users description: View all users Now rake test gives me errors saying no such table:

Boost test case and suite fixtures in manually defined suite tree

时光总嘲笑我的痴心妄想 提交于 2019-12-08 01:38:26
问题 Using Boost 1.46.1 on Windows x86, Android TI 2.2 I have defined my own test suite tree, since I need the user to choose order of the tests. although I'm aware the tests should be independent, this is a requirement. The test suite tree was redefined using my own implementation of test_suite* init_unit_test_suite(int, char**) . For automated test cases and automated test suites, there are Boost macros: BOOST_FIXTURE_TEST_CASE and BOOST_FIXTURE_TEST_SUITE( suite_name, F ) . These macros

Catchable Fatal Error: Argument 1 passed to (…) must be an instance of (…) integer given

╄→尐↘猪︶ㄣ 提交于 2019-12-07 17:12:14
问题 I'm making fixtures and when I try to load them I have an error. I need an instance of a Movie object but what I give, and I don't know why, is an integer. For this reason it says me that I have the following error: [Symfony\Component\Debug\Exception\ContextErrorException] Catchable Fatal Error: Argument 1 passed to Filmboot\MovieBundle\Document\A ward::setMovie() must be an instance of Filmboot\MovieBundle\Document\Movie , integer given, called in C:\Programming\xampp\htdocs\filmboot.web\src

ActiveRecord::Fixture::FixtureError: table “books” has no column named “loves”

和自甴很熟 提交于 2019-12-07 16:55:40
问题 Bizarre Rails problem. I have a Book entity and users can Love a book. All my other models are fine and passing all the tests but after generating the new Love model and setting the fixtures, I am getting a ton of these errors out of the blue: ActiveRecord::Fixture::FixtureError: table "books" has no column named "loves". I somehow think it's to do with reserved keywords in Rails perhaps? Is Love a reserved keyword by any chance? I did a search on this page: https://reservedwords.herokuapp

Boost test case and suite fixtures in manually defined suite tree

*爱你&永不变心* 提交于 2019-12-06 13:46:23
Using Boost 1.46.1 on Windows x86, Android TI 2.2 I have defined my own test suite tree, since I need the user to choose order of the tests. although I'm aware the tests should be independent, this is a requirement. The test suite tree was redefined using my own implementation of test_suite* init_unit_test_suite(int, char**) . For automated test cases and automated test suites, there are Boost macros: BOOST_FIXTURE_TEST_CASE and BOOST_FIXTURE_TEST_SUITE( suite_name, F ) . These macros register the function to the framework::master_test_suite() , which is undesired behavior in this case. Global

if condition in setUp() ignore test

我的梦境 提交于 2019-12-06 04:56:46
in unittest python library, exists the functions setUp and tearDown for set variables and other things pre and post tests. how I can run or ignore a test with a condition in setUp ? You can call if cond: self.skipTest('reason') in setUp() . Instead of checking in setUp , use the skipIf decorator. @unittest.skipIf(not os.path.exists("somefile.txt"), "somefile.txt is missing") def test_thing_requiring_somefile(self): ... skipIf can also be used on the class, so you can skip all contained tests if the condition does not hold. @unittest.skipIf(not os.path.exists("somefile.txt"), "somefile.txt is

Pytest - Fixture introspect on function level

浪子不回头ぞ 提交于 2019-12-06 03:22:01
I've got a fixture that requires a variable from the test function. Using introspection and declaring the variable in the function namespace/context should work if introspection on function level works, as it does for module level, but each time I run the code I end up with None instead of the string "Fancy Table". In the fixture I set the scope to 'function' and then introspect via getattr and request.function: #conftest.py @pytest.fixture(scope='function') def table(request): from data_setup import create_table table_name = getattr(request.function, "table_name", None) create_table(request,

Symfony2 DoctrineFixturesBundle namespace error

五迷三道 提交于 2019-12-05 19:43:33
I have a big problem with the fixtures bundle which I can't resolve. I follow the steps as they are meant to be followed, adding the lines to the deps file, installing them, registering them in the autoload and appkernel. When I try to run even only app/console , it breaks with: Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\Command\DoctrineCommand' not found in /var/www/.../bundles/Doctrine/Bundle/FixturesBundle/ Command/LoadDataFixturesDoctrineCommand.php on line 40 Which seems right because I don't have a DoctrineBundle directory under Doctrine\Bundle , only the DoctrineFixturesBundle .

How do I run Django tests on a copy of my production database?

风流意气都作罢 提交于 2019-12-05 16:37:38
问题 I've written a series of tests for my Django app, and would like to run them on a copy of my production database. As far as I can tell, the best way to do this is using fixture loading like so: Run manage.py dumpdata -o app.dump Move the resulting app.dump file to a fixtures directory in the [app name] folder Specify a 'fixtures' class attribute on my django.test.TestCase subclass However, this approach is cumbersome. I have multiple apps, and running manage.py dumpdata for each of them and

Fixtures and Selenium and Rails (oh my?)

六月ゝ 毕业季﹏ 提交于 2019-12-05 04:52:46
What data do you use with Selenium tests on Rails apps? Do you load from fixtures? Use an existing dev db? Use a separate (non-fixture) db? I'm considering my options here. I have a Rails app with a large Selenium test suite that runs on a modified version of Selenium Grid. Part of the process, right now, is loading a large set of fixtures, once, before the test suite runs. It's a LOT of data. Most of it is reporting info exported from our production db. When I set it up originally, I exported the data to yaml from Oracle. Now there's been a schema change in some of the reporting tables, so of