def test_register(self): history.register(DataContext, fields=["name", "description", "json"]) self.assertTrue(DataContext in history.registry) self.assertEqual( history.registry[DataContext], {"fields": ("json", "name", "description"), "dispatch_uid": "DataContext_revision"}, ) history.unregister(DataContext) self.assertFalse(DataContext in history.registry)
def test_register(self): history.register(DataContext, fields=['name', 'description', 'json']) self.assertTrue(DataContext in history.registry) self.assertEqual(history.registry[DataContext], { 'fields': ('json', 'name', 'description'), 'dispatch_uid': 'DataContext_revision', }) history.unregister(DataContext) self.assertFalse(DataContext in history.registry)
def setUp(self): history.register(DataContext, fields=['name', 'description', 'json'])
def setUp(self): history.register(DataContext, fields=["name", "description", "json"])
# again. if self.shared_users.filter(email__iexact=email).exists(): return False try: user = User.objects.get(email__iexact=email) except User.DoesNotExist: if not create_user: return False else: user = utils.create_email_based_user(email) self.shared_users.add(user) self.save() # Register instance-level cache invalidation handlers post_save.connect(post_save_cache, sender=DataField) post_save.connect(post_save_cache, sender=DataConcept) post_save.connect(post_save_cache, sender=DataCategory) pre_delete.connect(pre_delete_uncache, sender=DataField) pre_delete.connect(pre_delete_uncache, sender=DataConcept) pre_delete.connect(pre_delete_uncache, sender=DataCategory) # Register with history API if settings.HISTORY_ENABLED: history.register(DataContext, fields=('name', 'description', 'json')) history.register(DataView, fields=('name', 'description', 'json')) history.register(DataQuery, fields=('name', 'description', 'context_json', 'view_json'))
return False try: user = User.objects.get(email__iexact=email) except User.DoesNotExist: if not create_user: return False else: user = utils.create_email_based_user(email) self.shared_users.add(user) self.save() # Register instance-level cache invalidation handlers post_save.connect(post_save_cache, sender=DataField) post_save.connect(post_save_cache, sender=DataConcept) post_save.connect(post_save_cache, sender=DataCategory) pre_delete.connect(pre_delete_uncache, sender=DataField) pre_delete.connect(pre_delete_uncache, sender=DataConcept) pre_delete.connect(pre_delete_uncache, sender=DataCategory) # Register with history API if settings.HISTORY_ENABLED: history.register(DataContext, fields=('name', 'description', 'json')) history.register(DataView, fields=('name', 'description', 'json')) history.register(DataQuery, fields=('name', 'description', 'context_json', 'view_json'))