当前位置: 首页>>代码示例>>Python>>正文


Python AutoChanges.different_attributes方法代码示例

本文整理汇总了Python中south.creator.changes.AutoChanges.different_attributes方法的典型用法代码示例。如果您正苦于以下问题:Python AutoChanges.different_attributes方法的具体用法?Python AutoChanges.different_attributes怎么用?Python AutoChanges.different_attributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在south.creator.changes.AutoChanges的用法示例。


在下文中一共展示了AutoChanges.different_attributes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_no_change

# 需要导入模块: from south.creator.changes import AutoChanges [as 别名]
# 或者: from south.creator.changes.AutoChanges import different_attributes [as 别名]
 def test_no_change(self):
     "Test with a completely unchanged definition."
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['southdemo.Lizard']"}),
             ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['southdemo.Lizard']"}),
         ),
         False,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.related.ForeignKey', ['ohhai', 'there'], {'to': "somewhere", "from": "there"}),
             ('django.db.models.fields.related.ForeignKey', ['ohhai', 'there'], {"from": "there", 'to': "somewhere"}),
         ),
         False,
     )
开发者ID:brynn,项目名称:slowdown,代码行数:20,代码来源:autodetection.py

示例2: test_kwd_change

# 需要导入模块: from south.creator.changes import AutoChanges [as 别名]
# 或者: from south.creator.changes.AutoChanges import different_attributes [as 别名]
 def test_kwd_change(self):
     "Test a changed keyword argument"
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.CharField', ['pi'], {'to': "foo"}),
             ('django.db.models.fields.CharField', ['pi'], {'to': "blue"}),
         ),
         True,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.CharField', [], {'to': "foo"}),
             ('django.db.models.fields.CharField', [], {'to': "blue"}),
         ),
         True,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.CharField', ['b'], {'to': "foo"}),
             ('django.db.models.fields.CharField', ['b'], {'to': "blue"}),
         ),
         True,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.CharField', [], {'to': "foo"}),
             ('django.db.models.fields.CharField', [], {}),
         ),
         True,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.CharField', ['a'], {'to': "foo"}),
             ('django.db.models.fields.CharField', ['a'], {}),
         ),
         True,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.CharField', [], {}),
             ('django.db.models.fields.CharField', [], {'to': "foo"}),
         ),
         True,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.CharField', ['a'], {}),
             ('django.db.models.fields.CharField', ['a'], {'to': "foo"}),
         ),
         True,
     )
开发者ID:brynn,项目名称:slowdown,代码行数:60,代码来源:autodetection.py

示例3: test_pos_change

# 需要导入模块: from south.creator.changes import AutoChanges [as 别名]
# 或者: from south.creator.changes.AutoChanges import different_attributes [as 别名]
 def test_pos_change(self):
     "Test with a changed positional argument."
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.CharField', ['hi'], {'to': "foo"}),
             ('django.db.models.fields.CharField', [], {'to': "foo"}),
         ),
         True,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.CharField', [], {'to': "foo"}),
             ('django.db.models.fields.CharField', ['bye'], {'to': "foo"}),
         ),
         True,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.CharField', ['pi'], {'to': "foo"}),
             ('django.db.models.fields.CharField', ['pi'], {'to': "foo"}),
         ),
         False,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.CharField', ['pisdadad'], {'to': "foo"}),
             ('django.db.models.fields.CharField', ['pi'], {'to': "foo"}),
         ),
         True,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.CharField', ['hi'], {}),
             ('django.db.models.fields.CharField', [], {}),
         ),
         True,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.CharField', [], {}),
             ('django.db.models.fields.CharField', ['bye'], {}),
         ),
         True,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.CharField', ['pi'], {}),
             ('django.db.models.fields.CharField', ['pi'], {}),
         ),
         False,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('django.db.models.fields.CharField', ['pi'], {}),
             ('django.db.models.fields.CharField', ['45fdfdf'], {}),
         ),
         True,
     )
开发者ID:brynn,项目名称:slowdown,代码行数:68,代码来源:autodetection.py

示例4: test_backcompat_nochange

# 需要导入模块: from south.creator.changes import AutoChanges [as 别名]
# 或者: from south.creator.changes.AutoChanges import different_attributes [as 别名]
 def test_backcompat_nochange(self):
     "Test that the backwards-compatable comparison is working"
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('models.CharField', [], {}),
             ('django.db.models.fields.CharField', [], {}),
         ),
         False,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('models.CharField', ['ack'], {}),
             ('django.db.models.fields.CharField', ['ack'], {}),
         ),
         False,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('models.CharField', [], {'to':'b'}),
             ('django.db.models.fields.CharField', [], {'to':'b'}),
         ),
         False,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('models.CharField', ['hah'], {'to':'you'}),
             ('django.db.models.fields.CharField', ['hah'], {'to':'you'}),
         ),
         False,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('models.CharField', ['hah'], {'to':'you'}),
             ('django.db.models.fields.CharField', ['hah'], {'to':'heh'}),
         ),
         True,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('models.CharField', ['hah'], {}),
             ('django.db.models.fields.CharField', [], {'to':"orm['appname.hah']"}),
         ),
         False,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('models.CharField', ['hah'], {}),
             ('django.db.models.fields.CharField', [], {'to':'hah'}),
         ),
         True,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('models.CharField', ['hah'], {}),
             ('django.db.models.fields.CharField', [], {'to':'rrr'}),
         ),
         True,
     )
     
     self.assertEqual(
         AutoChanges.different_attributes(
             ('models.CharField', ['hah'], {}),
             ('django.db.models.fields.IntField', [], {'to':'hah'}),
         ),
         True,
     )
开发者ID:brynn,项目名称:slowdown,代码行数:76,代码来源:autodetection.py


注:本文中的south.creator.changes.AutoChanges.different_attributes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。