fixtures

symfony fixtures: set ondelete: CASCADE on refclass table

吃可爱长大的小学妹 提交于 2019-12-13 06:32:49
问题 I'm using symfony 1.4.5, Doctrine 1.2 and Mysql 5. In my schema.yml I have a few Many-to-Many relations which work great. But I need the joining table to have onDelete: CASCADE. Now for doctrine it is needed to add onDelete: CASCADE on the side where the foreignkey exists but since the refclass does not have any relations in the schema.yml I can't. example schema: Organisatie: connection: doctrine tableName: organisatie columns: org_id: type: integer(4) fixed: false unsigned: false primary:

How to pass service config to the Xunit project Test controller?

心不动则不痛 提交于 2019-12-13 03:33:08
问题 I have below setup currently. Startup Class : Startup.cs public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } public void ConfigureServices(IServiceCollection services) { services.Configure<AzureStorageConfig>(Configuration.GetSection("AzureStorageConfig")); services.AddTransient<IAzureService, AzureService>(); } //other config settings ... } Class: AzureStorageConfig //store the azure account

How to run server as fixture for py.test

a 夏天 提交于 2019-12-12 18:25:48
问题 I want to write Selenium tests with server as fixture: import pytest @pytest.fixture() def driver(request): from selenium import webdriver d = webdriver.Firefox() request.addfinalizer(d.close) return d @pytest.fixture() def server(): from server import run run(host="localhost", port=8080) def test_can_see_echo(driver,server): page = TestPage(driver) page.fill_text_in_input("test") page.click_send() print page.get_returnet_value() Function run in server fixture is bottle run function. The

How to load Django fixtures from all apps?

血红的双手。 提交于 2019-12-12 12:19:37
问题 I'm using fixtures in my Django application but only two apps are getting their fixtures loaded. When I manually run loaddata with --verbosity=2 I can see that it only looks in two apps although I have more with fixtures directories created inside. All apps are correctly installed in settings.py. From the documentation it seems that Django is supposed to search in the fixtures/ directory of every installed application. Any ideas why some apps are ignored ? 回答1: Initial_data gets imported each

how to create default users on django init_data?

被刻印的时光 ゝ 提交于 2019-12-12 12:10:01
问题 How can I loaddata for default list of users, when I syncdb ? 回答1: What I do. Create users manually. Do a dumpdata for the auth.users table. After doing syncdb, do a loaddata for the dumped users. It's not totally "automatic" because -- in the long run -- totally automatic is a terrible idea. Most syncdb operations involve database changes that also require you preserve some legacy data, perhaps dropping tables, and doing other "schema migration" steps. Each time it involves something special

has_many :through creating child after_save --> ActionView::Template::Error

梦想的初衷 提交于 2019-12-12 06:19:10
问题 I have three models: List, Food, and Quantity. List and Food are associated through Quantity via has_many :through. The model association is doing what I want, but when I test, there is an error. test_valid_list_creation_information#ListsCreateTest (1434538267.92s) ActionView::Template::Error: ActionView::Template::Error: Couldn't find Food with 'id'=14 app/views/lists/show.html.erb:11:in `block in _app_views_lists_show_html_erb__3286583530286700438_40342200' app/views/lists/show.html.erb:10

Rails 3.0.7 with ruby 1.9.2 fixtures with :belongs_to and :has_many gives “table users has no column named posts”

我的未来我决定 提交于 2019-12-11 17:09:14
问题 I can't get these fixtures to load and I don't know why. After spending a few hours on the problem and starting to seriously question my grasp of reality. So I turn here in hope of someone pointing out the error with hopefully minimal ridicule. I have tried doing it the same way as the api-docs describe and combining with the authlogic documentation. None of the posts I could find here on SO were of any help either. Using ruby 1.9.2-p180 users.yml one: id: 0 username: testuserone email:

Symfony 3.4 - “no commands defined in the “doctrine:schema” namespace” when attempting to run console command in class

我是研究僧i 提交于 2019-12-11 06:47:25
问题 I'm following along with this blog to create unit tests that use my data fixtures as a base. The relevant code: namespace Tests\AppBundle\Repository; use Symfony\Component\Console\Application; use Symfony\Component\Console\Input\StringInput; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class DataFixtureTestCase extends WebTestCase { protected $client, $container, $em; protected static $application; /** * {@inheritdoc} */ protected function setUp() { self::runCommand('doctrine:schema

Add log separators to all fixtures in unittests

风流意气都作罢 提交于 2019-12-11 04:06:55
问题 I'm using unittest module. I need to separate setUp, setUpClass, teardown and teardownClass logs from unittests logs. Output should look something like: **************setting things up************** INFO: preparing database INFO: create new users **************end of setup**************** INFO: starting test one INFO: ... **************Cleaning things************** INFO: delete users ... I tried to override some functions in unittest.suite (_handleClassSetUp, _handleModuleFixtures,

Symfony doctrine data-load segmentation fault

穿精又带淫゛_ 提交于 2019-12-11 03:57:07
问题 I'm working through the Symfony Jobeet tutorial and am getting a segmentation fault when trying to load data from my fixtures files. PHP 5.2.6-1+lenny8 with Suhosin-Patch 0.9.6.2 (cli), S symfony version 1.4.5 I'm using the Doctrine plugin. My fixtures below: /data/fixtures/categories.yml JobeetCategory: design: name: Design programming: name: Programming manager: name: Manager administrator: name: Administrator /data/fixtures/jobs.yml JobeetJob: job_sensio_labs: JobeetCategory: programming