import factory

from admin.common_auth.models import MyUser


class UserFactory(factory.Factory):
    class Meta:
        model = MyUser

    id = 123
    email = 'cello@email.org'
    first_name = 'Yo-yo'
    last_name = 'Ma'
    osf_id = 'abc12'

    @classmethod
    def is_in_group(cls, value):
        return True

import factory

from admin.common_auth.models import AdminProfile
from osf_tests.factories import UserFactory as OSFUserFactory


class UserFactory(factory.Factory):
    class Meta:
        model = AdminProfile

    user = OSFUserFactory

    desk_token = 'el-p'
    test_token_secret = 'mike'

    @classmethod
    def is_in_group(cls, value):
        return True

Fix up admin user factory to reflect model changes
Fix up admin user factory to reflect model changes

  import factory
  
- from admin.common_auth.models import MyUser
+ from admin.common_auth.models import AdminProfile
+ from osf_tests.factories import UserFactory as OSFUserFactory
  
  
  class UserFactory(factory.Factory):
      class Meta:
-         model = MyUser
+         model = AdminProfile
  
+     user = OSFUserFactory
+ 
+     desk_token = 'el-p'
+     test_token_secret = 'mike'
-     id = 123
-     email = 'cello@email.org'
-     first_name = 'Yo-yo'
-     last_name = 'Ma'
-     osf_id = 'abc12'
  
      @classmethod
      def is_in_group(cls, value):
          return True
  
Fix up admin user factory to reflect model changes
## Code Before:
import factory

from admin.common_auth.models import MyUser


class UserFactory(factory.Factory):
    class Meta:
        model = MyUser

    id = 123
    email = 'cello@email.org'
    first_name = 'Yo-yo'
    last_name = 'Ma'
    osf_id = 'abc12'

    @classmethod
    def is_in_group(cls, value):
        return True

## Instruction:
Fix up admin user factory to reflect model changes
## Code After:
import factory

from admin.common_auth.models import AdminProfile
from osf_tests.factories import UserFactory as OSFUserFactory


class UserFactory(factory.Factory):
    class Meta:
        model = AdminProfile

    user = OSFUserFactory

    desk_token = 'el-p'
    test_token_secret = 'mike'

    @classmethod
    def is_in_group(cls, value):
        return True
