def setUp(self):
        # Create a test user
        self.test_user = User.objects.create_user(
                "user", "user@user.com", "password")
        profile = UserProfile.get_or_create_profile(self.test_user)

        # Create a test admin
        self.test_admin = User.objects.create_superuser(
                "admin", "admin@user.com", "password")
        
        # Assign a flowpsace to uer
        self.user_ip_src_s = random.randint(0,0x80000000) & 0xFFFF0000
        self.user_ip_src_e = random.randint(0x80000000,0xFFFFFFFF) & 0xFFFF0000
    
        # Assign a flowpsace to experiment
        self.exp_ip_src_s = random.randint(0,0x80000000) & 0xFFFF0000
        self.exp_ip_src_e = random.randint(0x80000000,0xFFFFFFFF) & 0xFFFF0000
        
        # Choose a random field
        fields=["dl_src","dl_dst","vlan_id","tp_src","tp_dst"]
        random.shuffle(fields)
        (to_str,from_str,width,om_name,of_name) = om_ch_translate.attr_funcs[fields[0]]
        self.user_field_name = om_name
        self.user_field_s = random.randint(0,2**width-3)
        self.user_field_e = self.user_field_s + 1
        (to_str,from_str,width,om_name,of_name) = om_ch_translate.attr_funcs[fields[1]]
        self.exp_field_name = om_name
        self.exp_field_s = random.randint(0,2**width-3)
        self.exp_field_e = self.exp_field_s + 1 
              
        #save flowspace for user
        ufs = UserFlowSpace(user=self.test_user, ip_src_s=self.user_ip_src_s,
                             ip_src_e=self.user_ip_src_e,approver=self.test_admin)
        setattr(ufs,"%s_s"%self.user_field_name,self.user_field_s)
        setattr(ufs,"%s_e"%self.user_field_name,self.user_field_e)
        ufs.save()     
    
        #create an experiment and assign a flowspace to it
        exp = Experiment.objects.create(slice_id="slice_id_1", project_name="project name_1",
                                  project_desc="project description", slice_name="slice name_1",
                                  slice_desc="slice description", controller_url="controller url",
                                  owner_email="owner email", owner_password="owner password") 
        expfs = ExperimentFLowSpace.objects.create(exp=exp, dpid="00:00:00:00:00:00:01",
                            ip_src_s=self.exp_ip_src_s, 
                            ip_src_e=self.exp_ip_src_e, 
                             )
        setattr(expfs,"%s_s"%self.exp_field_name,self.exp_field_s)
        setattr(expfs,"%s_e"/self.exp_field_name,self.exp_field_e)
        expfs.save()     

        # Create dummy FV
        fv = DummyFV.objects.create()
        # Load up a fake topology in the Dummy FV
        fv.populateTopology(10, 20, use_random=USE_RANDOM)
            
        # create fake users for the Dummy FV
        username = "om"
        password = "password"
        u = User.objects.create(username=username)
        u.set_password(password)
        u.save()

        # Create the FV proxy connection
        FVServerProxy.objects.create(
            name="Flowvisor",
            username=username,
            password=password,

            url = SCHEME+"://%s:8443/dummyfv/%d/xmlrpc/" % (
                    HOST,fv.id,
            ),
        )
            
        #Login
        logged = self.client.login(username="user",password="password")
        self.assertEqual(logged,True)
dataset/ETHPy150Open fp7-ofelia/ocf/optin_manager/src/python/openflow/optin_manager/opts/tests.py/Tests.setUp/operator `%` -> `/`